You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(logging): suppress verbose log pollution in build plugins and remove handlers when disabled
This pull request resolves verbose logging output and terminal pollution when building and installing packages utilizing the `git-versioned` backend plugins.
### Key Changes
- **Silence Build Plugins:** Enforced `clear_loggers=True` and adjusted the default logger settings to `level="WARNING"` (down from `INFO`) within the Hatchling, Setuptools, and Maturin plugins.
- **Dangling Handlers Disposal:** Updated `configure_logger` to safely call `logger.remove()` on the active handler and reset the internal handler ID to `None` if logging is disabled.
- **Log Demotion on Fallbacks:** Demoted failed tag and archive resolution logs from `warning` to `info` within version source resolution. This avoids false warning messages when the tool falls back to other resolved sources.
- **Enhanced Test Suites:** Added target regression tests to cover cleanup of logging handlers and adapted E2E tests to verify silence during build operations under normal circumstances, alongside manual log injection flags.
## Type of Change
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update (changes to `README.md`, `SUPPORT.md`, docstrings, etc.)
- [x] Maintenance/Refactoring (non-breaking change that improves code structure or quality)
## Test Plan
All changes have been validated by running the local Python test suites through Hatch.
### Automated Test Execution
Run the unit, integration, and E2E regression tests using Hatch:
```bash
# Execute functional test suite (unit + integration tests)
.venv/bin/hatch run python:tests-func
# Execute E2E plugin and CLI integration test suite
.venv/bin/hatch run python:tests-e2e
```
### Results
- `tests-func` successfully executed **836 tests** (all PASSED).
- `tests-e2e` successfully executed **211 tests** (all PASSED).
## Related Issues
- Fixes #None
## Screenshots / Visuals (if applicable)
N/A
## Use of AI
- [ ] Includes AI-assisted code completion
- [x] Includes code generated by an AI application
- [x] Includes AI-generated tests
## Checklist
> [!IMPORTANT]
> Please review and complete this checklist before submitting your PR. This helps our maintainers process your contribution faster and ensures it meets the quality standards.
- [x] "I certify that all code in this PR is my own, except as noted below."
- [x] I have read the [CONTRIBUTING.md](../CONTRIBUTING.md) guide.
- [x] My code follows the established style guidelines.
- [x] I have performed a self-review of my own code.
- [x] I have commented my code, particularly in hard-to-understand areas.
- [x] I have made corresponding changes to the documentation.
- [x] My changes generate no new warnings or errors.
- [x] I have added tests that prove my fix is effective or that my feature works.
- [x] New and existing unit tests pass locally with my changes.
0 commit comments