Skip to content
Snippets Groups Projects
Commit b2a8911c authored by hang's avatar hang
Browse files

update log output

parent 32084969
No related branches found
No related tags found
No related merge requests found
......@@ -37,15 +37,13 @@ def recv_from_client(conn):
if event == REQUEST_DISCONNECT_MSG:
print(f"{timestamp} - {name} disconnected")
logger.info(f"{timestamp} - {name} disconnected")
break
if is_first_msg:
print(f"{timestamp} - {name} connected")
logger.info(f"{timestamp} - {name} connected")
else:
print(f"{timestamp} {name} {event}")
logger.info(f"{timestamp} {str(time.time())} {name} {event} {str(initial_msg_length + msg_length)}")
logger.info(f"{timestamp} {str(time.time())} {name} {event} {str(initial_msg_length + msg_length)}")
conn.close()
except Exception as e:
print(f"[ERROR] thread error:{e.__class__.__name__}.{e}.{traceback.format_exc()}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment