-
Couldn't load subscription status.
- Fork 456
fix(logger): correctly pick powertools or custom handler in custom environments #6083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #6083 +/- ##
========================================
Coverage 96.25% 96.26%
========================================
Files 234 234
Lines 11147 11160 +13
Branches 824 828 +4
========================================
+ Hits 10730 10743 +13
Misses 327 327
Partials 90 90 ☔ View full report in Codecov by Sentry. |
|



Original PR: #4295
Issue number: #4277
Summary
This PR fixes a bug when a compute environment or customer preconfigures a standard logging logger with the same Powertools logger name.
Previously, we'd always pick the first handler - child or parent. However, it led to pick the incorrect one if a logger we're creating for the first time (
Logger) was already pre-setup through other means (logging.getLogger).Changes
_get_handlerregistered_handleron_get_handlerAttributeErrorUser experience
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.