Skip to content

Commit

Permalink
logging
Browse files Browse the repository at this point in the history
  • Loading branch information
v00g100skr committed Jan 26, 2024
1 parent 6594755 commit b927113
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions deploy/websocket_server/websocket_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from aiomcache import Client
from functools import partial

debug_level = os.environ.get('DEBUG_LEVEL') or 'DEBUG'
debug_level = os.environ.get('DEBUG_LEVEL') or 'INFO'
websocket_port = os.environ.get('WEBSOCKET_PORT') or 1234

logging.basicConfig(level=debug_level,
Expand Down Expand Up @@ -88,15 +88,13 @@ def split_message(message):
case 'district':
logger.info(f"{client_ip}_{client_port}: {header} {data}")
await websocket.send(f"district callback: {data}")
logger.info(f"{client_ip}_{client_port}: {header} {data}")
case 'firmware':
logger.info(f"{client_ip}_{client_port}: {header} {data}")
client['software'] = data
case 'bins':
logger.info(f"{client_ip}_{client_port}: {header} {data}")
payload = '{"payload": "bins", "bins": %s}' % shared_data.bins
await websocket.send(payload)
logger.info(f"{client_ip}_{client_port}: {header} {data}")
case _:
logger.info(f"{client_ip}_{client_port}: unknown data request")
except websockets.exceptions.ConnectionClosedError as e:
Expand Down

0 comments on commit b927113

Please sign in to comment.