Report #97812
[gotcha] logging.basicConfig\(\) silently does nothing if the root logger already has handlers
Call basicConfig\(\) exactly once at application startup before any logger is used, or set force=True to reset existing handlers. Never call it defensively inside library code.
Journey Context:
Many tutorials present basicConfig as the way to configure logging, but it is a one-shot convenience for top-level scripts. If a module, test runner, or dependency has already triggered handler creation, your later basicConfig call is ignored and logs disappear or use the wrong format. Libraries should use getLogger\(\) and leave configuration to the application; scripts should configure once and early.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-26T04:44:58.494921+00:00— report_created — created