mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: add logs for python process
This commit is contained in:
parent
202f5b60de
commit
8c0c3e617b
4 changed files with 68 additions and 11 deletions
|
@ -20,6 +20,23 @@ if start_download_payload:
|
|||
class Handler(BaseHTTPRequestHandler):
|
||||
rpc_password_header = 'x-hydra-rpc-password'
|
||||
|
||||
skip_log_routes = [
|
||||
"process-list",
|
||||
"status"
|
||||
]
|
||||
|
||||
def log_error(self, format, *args):
|
||||
sys.stderr.write("%s - - [%s] %s\n" %
|
||||
(self.address_string(),
|
||||
self.log_date_time_string(),
|
||||
format%args))
|
||||
|
||||
def log_message(self, format, *args):
|
||||
for route in self.skip_log_routes:
|
||||
if route in args[0]: return
|
||||
|
||||
super().log_message(format, *args)
|
||||
|
||||
def do_GET(self):
|
||||
if self.path == "/status":
|
||||
if self.headers.get(self.rpc_password_header) != rpc_password:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue