File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -105,10 +105,7 @@ def run(
105105 help = f"A yaml file matching the { controller_class .__name__ } schema"
106106 ),
107107 ],
108- log_level : Annotated [
109- Optional [LogLevel ], # noqa: UP045
110- typer .Option (),
111- ] = None ,
108+ log_level : Annotated [LogLevel , typer .Option ()] = LogLevel .INFO ,
112109 graylog_endpoint : Annotated [
113110 Optional [GraylogEndpoint ], # noqa: UP045
114111 typer .Option (
Original file line number Diff line number Diff line change 1616drivers. This logger uses ``loguru`` as underlying logging library, which enables much
1717simpler configuration as well as structured logging.
1818
19- Keyword arguments to log statments will be attached as extra fields on the log record.
19+ Keyword arguments to log statements will be attached as extra fields on the log record.
2020These fields are displayed separately in the console output and can used for filtering
2121and metrics in graylog.
2222
@@ -70,7 +70,7 @@ def bind_logger(logger_name: str) -> Logger:
7070
7171
7272def configure_logging (
73- level : LogLevel | None = None ,
73+ level : LogLevel = LogLevel . INFO ,
7474 graylog_endpoint : GraylogEndpoint | None = None ,
7575 graylog_static_fields : GraylogStaticFields | None = None ,
7676 graylog_env_fields : GraylogEnvFields | None = None ,
@@ -95,7 +95,7 @@ def configure_logging(
9595
9696
9797# Configure logger with defaults - INFO level and disabled
98- configure_logging ( )
98+ _configure_logger ( logger )
9999
100100
101101class _StdLoggingInterceptHandler (logging .Handler ):
Original file line number Diff line number Diff line change @@ -87,6 +87,9 @@ def format_record(record) -> str:
8787 else :
8888 extras = ""
8989
90+ # Escape braces so Loguru doesn't parse them as format placeholders
91+ extras = extras .replace ("{" , "{{" ).replace ("}" , "}}" )
92+
9093 return f"""\
9194 <level>[{ time } { record ["level" ].name [0 ]} ]</level> \
9295{ record ["message" ]:<80} \
You can’t perform that action at this time.
0 commit comments