Skip to content

Conversation

@amyreese
Copy link
Member

Summary

logging.basicConfig should not be called at a global module scope,
as that produces a race condition to configure logging based on which
module gets imported first. Logging should instead be initialized
in an entrypoint to the program, either in a main() or in the
typical if __name__ == "__main__" block.

Test Plan

tbd

`logging.basicConfig` should not be called at a global module scope,
as that produces a race condition to configure logging based on which
module gets imported first.  Logging should instead be initialized
in an entrypoint to the program, either in a `main()` or in the
typical `if __name__ == "__main__"` block.
@astral-sh-bot
Copy link

astral-sh-bot bot commented Dec 20, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@MichaReiser MichaReiser added the documentation Improvements or additions to documentation label Dec 22, 2025
@amyreese amyreese force-pushed the amy/t201-basicconfig branch from f285a9a to cb9c09b Compare January 5, 2026 18:57
@amyreese amyreese merged commit 12a4ca0 into main Jan 5, 2026
40 checks passed
@amyreese amyreese deleted the amy/t201-basicconfig branch January 5, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants