Skip to content

Add level, time, and name to default format - #30

Merged
nsheff merged 2 commits into
devfrom
default-format-with-name
Aug 7, 2026
Merged

Add level, time, and name to default format#30
nsheff merged 2 commits into
devfrom
default-format-with-name

Conversation

@nsheff

@nsheff nsheff commented Aug 7, 2026

Copy link
Copy Markdown
Member

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 calling coloredlogs.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:

[INFO] [13:31:14] [geopephub.metageo_pephub] GSE: 'GSE12345' was added to the queue

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)s gives 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 fmt still overrides the default.

This does make output wider, and it changes what every logmuse user sees. Worth a look before it goes out.

nsheff added 2 commits August 7, 2026 13:41
CI installs ruff unpinned; 0.16 began formatting Python blocks inside markdown, so README started failing on every branch.
@nsheff
nsheff merged commit a28bad7 into dev Aug 7, 2026
1 check passed
@nsheff
nsheff deleted the default-format-with-name branch August 7, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant