Add level, time, and name to default format - #30
Merged
Conversation
CI installs ruff unpinned; 0.16 began formatting Python blocks inside markdown, so README started failing on every branch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
logmuse's default log format was a bare
%(message)s, so a log line showed no level, no timestamp, and no indication of where it came from. Almost every package downstream fixed that itself by callingcoloredlogs.install()with its own format string, and they all wrote roughly the same thing.There are about thirteen of those calls across pepdbagent, geopephub, pephubclient, bedboss, and pephub. Reaching for
coloredlogs.install()to set a format is also how those packages ended up configuring logging at import time, which is a separate problem we are currently cleaning up.This changes the default to include the level, the time, and the logger name:
The logger name deserves a note. Several packages were hardcoding a per-package tag like
[BEDBOSS]or[PEPDBAGENT]into their format strings, which is just the logger name written out by hand.%(name)sgives the same thing automatically, and gives the real originating logger rather than a fixed label, so submodules identify themselves. Downstream packages can drop those tags entirely.Developer mode and log file output are unchanged, and passing an explicit
fmtstill overrides the default.This does make output wider, and it changes what every logmuse user sees. Worth a look before it goes out.