@@ -43,8 +43,8 @@ async def status_handler(request: Request):
4343@api .post ("/socket/<connectionid>/send" )
4444async def socket_send (request : Request , connectionid : str ):
4545 """Send a message to a connected socket."""
46- LOGGER .info ("Inbound message for %s" , connectionid )
47- LOGGER .debug ("Existing connections: %s" , active_connections .keys ())
46+ LOGGER .info (f "Inbound message for { connectionid } " )
47+ LOGGER .debug (f "Existing connections: { active_connections .keys ()} " )
4848
4949 if connectionid not in active_connections :
5050 return text ("FAIL" , status = 500 )
@@ -60,8 +60,8 @@ async def socket_send(request: Request, connectionid: str):
6060@api .post ("/socket/<connectionid>/disconnect" )
6161async def socket_disconnect (request : Request , connectionid : str ):
6262 """Disconnect a socket."""
63- LOGGER .info ("Disconnect %s" , connectionid )
64- LOGGER .debug ("Existing connections: %s" , active_connections .keys ())
63+ LOGGER .info (f "Disconnect { connectionid } " )
64+ LOGGER .debug (f "Existing connections: { active_connections .keys ()} " )
6565
6666 if connectionid not in active_connections :
6767 return text ("FAIL" , status = 500 )
@@ -83,9 +83,9 @@ async def socket_handler(request: Request, websocket: Websocket):
8383 socket_id = websocket .ws_proto .id .hex
8484 active_connections [socket_id ] = websocket
8585 lifetime_connections += 1
86- LOGGER .debug ("Existing connections: %s" , active_connections .keys ())
87- LOGGER .debug ("Added connection: %s" , socket_id )
88- LOGGER .debug ("Request headers: %s" , dict (request .headers .items ()))
86+ LOGGER .debug (f "Existing connections: { active_connections .keys ()} " )
87+ LOGGER .debug (f "Added connection: { socket_id } " )
88+ LOGGER .debug (f "Request headers: { dict (request .headers .items ())} " )
8989
9090 await backend .socket_connected (
9191 connection_id = socket_id ,
@@ -105,5 +105,5 @@ async def socket_handler(request: Request, websocket: Websocket):
105105 # unregister user
106106 if socket_id :
107107 del active_connections [socket_id ]
108- LOGGER .info ("Removed connection: %s" , socket_id )
108+ LOGGER .info (f "Removed connection: { socket_id } " )
109109 await backend .socket_disconnected (socket_id )
0 commit comments