Stop configuring logging at import time#193
Conversation
Code review (xhigh: 10 angles → verify → sweep)Ten independent finder angles (line-scan, removed-behavior audit, cross-file trace, language pitfalls, logger-hierarchy correctness, reuse, simplification, efficiency, altitude, conventions), one adversarial verifier per deduped candidate, then a fresh-eyes gap sweep. Five candidates survived; verdicts and outcomes:
Verified clean: no consumer anywhere reads the four deleted module Gate after fixes: 644 tests + 102 snapshots pass, ruff + ruff-format + pyrefly clean. Gap sweep over the post-fix diff: no new findings. |
Implements .planners/plans/057-logging-no-import-side-effect/plan.md
Removes the module-scope
Logger().start(__name__)calls (ten sites) so plainimport WebSearcherno longer attaches a JSONL handler to the root logger or forces root to DEBUG. Modules now use plainlogging.getLogger(__name__); the package installs aNullHandleron its own logger; crawl-time configuration inSearchEngine.__init__is untouched.Verified:
import WebSearcherleaveslogging.getLogger().handlers == [](was a rootStreamHandler+ level DEBUG)logging.basicConfig(...)after import now takes effect (was a silent no-op)SearchEnginestill installs the JSONL console + file sinks and writes the crawl-log schema unchanged