From 8941135af435797f19aaf5adb9cadf39de58d439 Mon Sep 17 00:00:00 2001 From: anubhav Date: Mon, 13 Jan 2025 01:16:22 +0530 Subject: [PATCH] fix: incorrect datetime format for strftime() in windows The datetime format passed to Structlog's configuration inside setup_logging() in src/codegate/codegate_logging.py works on Linux but returns an error on Windows. Changed the datetime format so it works on Linux as well as Windows. --- src/codegate/codegate_logging.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codegate/codegate_logging.py b/src/codegate/codegate_logging.py index 14c5c49b..cb53ccc2 100644 --- a/src/codegate/codegate_logging.py +++ b/src/codegate/codegate_logging.py @@ -82,7 +82,7 @@ def setup_logging( # Adds log level and timestamp to log entries shared_processors = [ structlog.processors.add_log_level, - structlog.processors.TimeStamper(fmt="%Y-%m-%dT%H:%M:%S.%03dZ", utc=True), + structlog.processors.TimeStamper(fmt="%Y-%m-%dT%H:%M:%S.%fZ", utc=True), add_origin, structlog.processors.CallsiteParameterAdder( [