diff --git a/bundles/buildless/src/backend/app.py b/bundles/buildless/src/backend/app.py index 5c1423b..d968260 100644 --- a/bundles/buildless/src/backend/app.py +++ b/bundles/buildless/src/backend/app.py @@ -6,7 +6,7 @@ # Import the router from utilities.redis import wait_for_redis_sync, broadcast_sync, broadcast_async, receive_sync, receive_async, redict -from utilities.starlette import router +from utilities.starlette import WebSocket, router # Wait for redis to ping back before operating on database wait_for_redis_sync() @@ -25,7 +25,7 @@ def click_request() -> str: logging.info("User clicked - count is now %d", DATABASE.count) # Return the ping count - return "Click count is %d" % DATABASE.count + return f"Click count is {DATABASE.count}" @router.post("/api/relay") @@ -39,7 +39,7 @@ async def relay_request(message: str, sender: Optional[Email] = None) -> None: @router.socket("/socket/relay") -async def relay_socket(websocket) -> None: +async def relay_socket(websocket: WebSocket) -> None: # Accept the websocket await websocket.accept() diff --git a/bundles/buildless/src/backend/worker.py b/bundles/buildless/src/backend/worker.py index 4c9b4af..5fea34c 100644 --- a/bundles/buildless/src/backend/worker.py +++ b/bundles/buildless/src/backend/worker.py @@ -4,7 +4,7 @@ import threading # Setup the logging -logging.basicConfig(level=logging.INFO, format="%(process)d:W %(asctime)s * %(message)s", datefmt="%d %b %Y %H:%M:%S.000") +logging.basicConfig(level=logging.INFO, format="[%(asctime)s] [%(process)d] [%(levelname)s] %(message)s", datefmt="%Y-%m-%d %H:%M:%S %z") # Create stop event EVENT = threading.Event() diff --git a/bundles/independent/application/src/backend/app.py b/bundles/independent/application/src/backend/app.py index 5c1423b..d968260 100644 --- a/bundles/independent/application/src/backend/app.py +++ b/bundles/independent/application/src/backend/app.py @@ -6,7 +6,7 @@ # Import the router from utilities.redis import wait_for_redis_sync, broadcast_sync, broadcast_async, receive_sync, receive_async, redict -from utilities.starlette import router +from utilities.starlette import WebSocket, router # Wait for redis to ping back before operating on database wait_for_redis_sync() @@ -25,7 +25,7 @@ def click_request() -> str: logging.info("User clicked - count is now %d", DATABASE.count) # Return the ping count - return "Click count is %d" % DATABASE.count + return f"Click count is {DATABASE.count}" @router.post("/api/relay") @@ -39,7 +39,7 @@ async def relay_request(message: str, sender: Optional[Email] = None) -> None: @router.socket("/socket/relay") -async def relay_socket(websocket) -> None: +async def relay_socket(websocket: WebSocket) -> None: # Accept the websocket await websocket.accept() diff --git a/bundles/independent/application/src/backend/worker.py b/bundles/independent/application/src/backend/worker.py index 4c9b4af..5fea34c 100644 --- a/bundles/independent/application/src/backend/worker.py +++ b/bundles/independent/application/src/backend/worker.py @@ -4,7 +4,7 @@ import threading # Setup the logging -logging.basicConfig(level=logging.INFO, format="%(process)d:W %(asctime)s * %(message)s", datefmt="%d %b %Y %H:%M:%S.000") +logging.basicConfig(level=logging.INFO, format="[%(asctime)s] [%(process)d] [%(levelname)s] %(message)s", datefmt="%Y-%m-%d %H:%M:%S %z") # Create stop event EVENT = threading.Event()