Skip to content

FIX the run log printing to the terminal as well as the file - #8

Merged
emattei merged 2 commits into
mainfrom
fix/log-to-the-file-not-the-terminal
Oct 13, 2026
Merged

emattei merged 2 commits into
mainfrom
fix/log-to-the-file-not-the-terminal

Conversation

@emattei

@emattei emattei commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

import pyranges1 calls logging.basicConfig(level=logging.INFO), which
attaches a StreamHandler to the root logger and lowers its level. Every
INFO record the pipelines write then propagated to it and was printed to
stderr, so cau guide-annotation run and cau element-mapping run dumped
their internal log on the terminal next to their summary.

Each pipeline now clears propagate while its file handler is attached. The
log goes to the file, the summary to stdout, and nothing a library does to
the root logger can change that.

Before: 1.6 kB of stderr for a normal run. After: 0 bytes.

🤖 Generated with Claude Code

emattei and others added 2 commits October 13, 2026 17:54
pyranges calls logging.basicConfig on import, which puts a handler on the
root logger, so every INFO record the pipelines write propagated there and
was printed to stderr. The log belongs in the file; the command's own summary
is what goes to the terminal.

Each pipeline now clears propagate while its file handler is attached, so no
library's root handler can pick the records up.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The reversed-library test read the warning through caplog, which captures by
propagation and so could not see it any more. It now reads the run's own log
file, which is what the fix actually promises, and a new test fails if a
record ever reaches a root handler again.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@emattei
emattei merged commit 1d3a52b into main Oct 13, 2026
9 checks passed
@emattei
emattei deleted the fix/log-to-the-file-not-the-terminal branch October 13, 2026 21: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