From 8dabfec8855da47039f995f3e5dcb33e332d4613 Mon Sep 17 00:00:00 2001 From: Jonas Weinz Date: Thu, 21 Mar 2019 17:08:49 +0100 Subject: [PATCH] cleaned up debug messages --- connection_handler.py | 4 ++-- main.py | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/connection_handler.py b/connection_handler.py index 9af7468..f3c62a9 100644 --- a/connection_handler.py +++ b/connection_handler.py @@ -114,7 +114,7 @@ class ConnectionHandler(object): socket: websockets.WebSocketServerProtocol, login_msg: str): msg = parse_message(login_msg) - print(msg) + print("new incomming connection...") if msg is None: return None @@ -474,7 +474,7 @@ class ConnectionHandler(object): async def handle_message(self, conn, msg_str): msg = parse_message(msg_str) - print(msg) + print("incoming message" + msg) if msg is None: return None diff --git a/main.py b/main.py index e5d4531..967ab9b 100644 --- a/main.py +++ b/main.py @@ -29,19 +29,17 @@ DatabaseConnection(db_host, async def socket_worker(websocket, path): connection = None - print("new incomin connection") try: raw_msg = await websocket.recv() connection = await ch.new_connection(websocket, raw_msg) - print(ch.open_connections_by_id) - print(ch.open_connections_by_user) - if connection is None: return + print("successfull logged in user: " + connection.user_name) + async for m in websocket: await ch.handle_message(connection, m) @@ -59,7 +57,6 @@ async def socket_worker(websocket, path): id = None if connection: id = connection.user_name - print(ch.open_connections_by_id) await ch.disconnect(connection) await connection.close()