Skip to content

fix: use module logger instead of root logger in b_aiosqlite.py#758

Merged
skrawcz merged 1 commit into
apache:mainfrom
dashitongzhi:fix/root-logger-aiosqlite
May 11, 2026
Merged

fix: use module logger instead of root logger in b_aiosqlite.py#758
skrawcz merged 1 commit into
apache:mainfrom
dashitongzhi:fix/root-logger-aiosqlite

Conversation

@dashitongzhi

Copy link
Copy Markdown
Contributor

Problem

In burr/integrations/persisters/b_aiosqlite.py, the logger is created using logging.getLogger() (no arguments), which returns the root logger. Every other persister module in the same package uses logging.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() to logging.getLogger(__name__) for consistency with all other persister implementations:

# Before
logger = logging.getLogger()

# After
logger = logging.getLogger(__name__)

This is a one-line fix. All other persisters already use this pattern:

  • b_pymongo.pylogging.getLogger(__name__)
  • b_mongodb.pylogging.getLogger(__name__)
  • b_redis.pylogging.getLogger(__name__)
  • b_asyncpg.pylogging.getLogger(__name__)
  • b_psycopg2.pylogging.getLogger(__name__)
  • postgresql.pylogging.getLogger(__name__)

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.
Copilot AI review requested due to automatic review settings May 7, 2026 14:05
@github-actions github-actions Bot added area/storage Persisters, state storage area/integrations External integrations (LLMs, frameworks) labels May 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.py from logging.getLogger() (root logger) to logging.getLogger(__name__) (module logger).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dashitongzhi

Copy link
Copy Markdown
Contributor Author

Friendly ping for review 🙏 This is a small, focused fix. CI is passing. Thank you!

@dashitongzhi

Copy link
Copy Markdown
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 skrawcz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — logging.getLogger()logging.getLogger(__name__) for consistency with all other persister modules. One-line fix, correct pattern.

@skrawcz skrawcz enabled auto-merge (rebase) May 11, 2026 05:02
@skrawcz skrawcz merged commit 7b20492 into apache:main May 11, 2026
29 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/integrations External integrations (LLMs, frameworks) area/storage Persisters, state storage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants