Skip to content

Clean up the mess related to configure_from_file and configure_from_dict#93

Open
tintoy wants to merge 11 commits intomasterfrom
smok-serwis-merge/issue76
Open

Clean up the mess related to configure_from_file and configure_from_dict#93
tintoy wants to merge 11 commits intomasterfrom
smok-serwis-merge/issue76

Conversation

@tintoy
Copy link
Owner

@tintoy tintoy commented Aug 9, 2025

Note: this PR is a rebase of PR #78 by @piotrmaslanka as part of the work in #92.

Since this introduces some breaking changes, I'd invite @tintoy to express what should be left.

Right now everything can be configured using logging.config.dictConfig() including CLEF, override_root_logger and use_structured_logging

Also, this adds an option for ConsoleStructuredLogHandler to output to stderr. It's a config option.

I've tested it on my staging environment.

Also, I wonder, because right now by configuring one handler you can change the feature flags globally (for other loggers), shouldn't we move that to private properties of SeqLogHandlers? Because this behavior is not immediately obvious and somewhat astonishing.

Also, current implementation allows you to configure whether to use CLEF on the level of a ConsoleStructuredLogHandler, which is a code smell (and just plainly doesn't make sense, as a ConsoleStructuredLogHandler will never have to deal with CLEF), which amounts to, how one physicist put it as "spooky action at a distance".

I suggest we slowly shift towards per-handler configuration instead of global feature flags.

@tintoy tintoy requested a review from piotrmaslanka August 9, 2025 05:41
@tintoy tintoy self-assigned this Aug 9, 2025
@tintoy tintoy added enhancement breaks-compat Breaks compatibility labels Aug 9, 2025
@tintoy tintoy linked an issue Aug 9, 2025 that may be closed by this pull request
2 tasks
@tintoy tintoy changed the title Smok serwis merge/issue76 Clean up the mess related to configure_from_file and configure_from_dict Aug 9, 2025
@tintoy tintoy mentioned this pull request Aug 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaks-compat Breaks compatibility enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merge PR #78

2 participants