Conversation
|
There was a problem hiding this comment.
Pull request overview
PR move plugin-name prefixing in logs from logging.Filter into custom logging.Formatter, so logging setup can grow into future config-driven format.
Changes:
- Remove
PluginLogFilterfrom plugin logger setup. - Add
LegacyFormatterand set it on defaultbeetsUI stream handler to buildmusicbrainz: msgstyle output. - Note internal refactor in changelog.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| docs/changelog.rst | Document switch from filter-based to formatter-based plugin prefixing. |
| beets/ui/init.py | Default beets logger handler now uses LegacyFormatter("%(legacy_msg)s"). |
| beets/plugins.py | Stop attaching per-plugin PluginLogFilter to plugin child loggers. |
| beets/logging.py | Introduce LegacyFormatter that builds legacy_msg from child logger name + message. |
|
Current test failures are expected as the caplog setup we use currently in testing does not capture the formatting correctly. |
bf9ff64 to
83c1867
Compare
I guess you want to rebase this on the branch that fixes the caplog setup? |
Yeah that was my idea. I did not want to fixup the |
This pull request refactors how log messages are formatted in the codebase, specifically replacing the use of a logging filter with a custom logging formatter to append plugin names to log messages. This change improves flexibility and future extensibility for logging setups.
This is part of the multi-step efforts to improve logging in beets #6553
This change should yield no visible change for users and is entirely a internal refactor: