fix: use module logger instead of root logger in b_aiosqlite.py#758
Merged
Conversation
All other persister modules in burr/integrations/persisters/ use logging.getLogger(__name__) to create a properly scoped logger. b_aiosqlite.py was using logging.getLogger() (no arguments), which returns the root logger. Using the root logger is bad practice because: - It causes log messages to bypass the module's namespace, making it harder to filter or configure logging for this specific module. - It can lead to unexpected log output appearing in the root logger's handlers even when the module's logging is intended to be suppressed. This one-line fix changes it to logging.getLogger(__name__) for consistency with all other persister implementations.
There was a problem hiding this comment.
Pull request overview
Updates the SQLite async persister to use a module-scoped logger instead of the root logger, aligning its logging behavior with the rest of the persister integrations.
Changes:
- Switch
b_aiosqlite.pyfromlogging.getLogger()(root logger) tologging.getLogger(__name__)(module logger).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
Friendly ping for review 🙏 This is a small, focused fix. CI is passing. Thank you! |
Contributor
Author
|
Hi! 👋 This PR has passed all CI checks and looks ready for review. Could a maintainer please take a look when they have a chance? Thank you! |
skrawcz
approved these changes
May 11, 2026
skrawcz
left a comment
Contributor
There was a problem hiding this comment.
LGTM — logging.getLogger() → logging.getLogger(__name__) for consistency with all other persister modules. One-line fix, correct pattern.
skrawcz
approved these changes
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In
burr/integrations/persisters/b_aiosqlite.py, the logger is created usinglogging.getLogger()(no arguments), which returns the root logger. Every other persister module in the same package useslogging.getLogger(__name__)to create a properly scoped module logger.Using the root logger causes log messages to bypass the module's namespace, making it harder to filter or configure logging for this specific module, and can lead to unexpected log output appearing in root logger handlers even when the module's logging is intended to be suppressed.
Fix
Changed
logging.getLogger()tologging.getLogger(__name__)for consistency with all other persister implementations:This is a one-line fix. All other persisters already use this pattern:
b_pymongo.py→logging.getLogger(__name__)b_mongodb.py→logging.getLogger(__name__)b_redis.py→logging.getLogger(__name__)b_asyncpg.py→logging.getLogger(__name__)b_psycopg2.py→logging.getLogger(__name__)postgresql.py→logging.getLogger(__name__)