Skip to content

Don't setLevel on the library logger#230

Merged
derek73 merged 1 commit into
masterfrom
fix/no-loglevel-override
Jul 5, 2026
Merged

Don't setLevel on the library logger#230
derek73 merged 1 commit into
masterfrom
fix/no-loglevel-override

Conversation

@derek73

@derek73 derek73 commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • nameparser/util.py called log.setLevel(logging.ERROR) on the HumanName logger at import time, which silently discards log records regardless of how the application configures its root/child logger levels.
  • Libraries should attach a handler (already done via NullHandler) but leave the level at NOTSET so applications control verbosity.
  • __main__.py keeps its own explicit setLevel(logging.ERROR) for CLI use, which is unaffected.

Fixes #228

Test plan

  • python -m pytest -q — 1340 passed, 4 skipped, 22 xfailed

🤖 Generated with Claude Code

Fixes #228. Libraries should attach a NullHandler and leave the level
at NOTSET so applications control verbosity; setLevel(ERROR) here
silently discarded log records regardless of the app's root logger
configuration. __main__.py already configures its own logger for CLI
use and is unaffected.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@derek73 derek73 self-assigned this Jul 5, 2026
@derek73 derek73 added this to the v1.3.0 milestone Jul 5, 2026
@derek73 derek73 added the bug label Jul 5, 2026
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.29%. Comparing base (9514ba3) to head (aa54102).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #230      +/-   ##
==========================================
- Coverage   97.30%   97.29%   -0.01%     
==========================================
  Files          13       13              
  Lines         815      814       -1     
==========================================
- Hits          793      792       -1     
  Misses         22       22              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@derek73 derek73 merged commit 89a6877 into master Jul 5, 2026
8 checks passed
@derek73 derek73 deleted the fix/no-loglevel-override branch July 5, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Don't setLevel on the library logger

2 participants