better logging
This commit is contained in:
parent
c7ce20a3b9
commit
6eff308468
2 changed files with 9 additions and 10 deletions
|
|
@ -245,7 +245,7 @@ class Handler(http.server.SimpleHTTPRequestHandler):
|
|||
}
|
||||
self.write_response(response_status, content)
|
||||
return
|
||||
logger.debug('NODE action %s %s (%s)', action, args, user_id)
|
||||
logger.debug('%s requests %s%s', user_id, action, args)
|
||||
if action == 'ping':
|
||||
content = {
|
||||
'status': 'ok'
|
||||
|
|
@ -267,9 +267,11 @@ class Handler(http.server.SimpleHTTPRequestHandler):
|
|||
self.send_header('Content-Type', 'application/json')
|
||||
content = json.dumps(content, ensure_ascii=False).encode('utf-8')
|
||||
content = self.gzip_data(content)
|
||||
self.send_header('Content-Length', str(len(content)))
|
||||
content_length = len(content)
|
||||
self.send_header('Content-Length', str(content_length))
|
||||
self.end_headers()
|
||||
self.wfile.write(content)
|
||||
logger.debug('%s bytes response', content_length)
|
||||
|
||||
def chunk_size(self, content_length):
|
||||
return min(16*1024, content_length)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue