Message396327
The method `_handle_existing_loggers` in the logging lib (called when configuring loggers using dictConfig) iterates over all existing loggers and sets their .disabled attribute according to the `disable_existing_loggers` parameter (usually set to false)
However this only lets the user completely disable/enable all existing loggers, and there is no way to tell the function to keep the value to what it was
This example was how I found about it
1. Imported the pkg ddtrace, which writes some logs that I'm not interested in
2. Disabled the ddtrace logger
`logging.getLogger('ddtrace.internal.writer').disabled = True`
3. Imported the pkg Sanic, which configures its logging using `logging.configure.dictConfig()`, with `disable_existing_loggers` set to False, as it doesn't want to disable all of the loggers that were created before it
4. `_handle_existing_loggers` re-enabled the logger that I manually disabled before
Ps. apologies if this is not the correct place, I don't really see this as a bug, more like a feature request, however the only place I found for feature requests were PEPs, which this obviously isnt |
|
Date |
User |
Action |
Args |
2021-06-22 12:57:06 | ronserruya2 | set | recipients:
+ ronserruya2 |
2021-06-22 12:57:06 | ronserruya2 | set | messageid: <1624366626.62.0.782556758458.issue44489@roundup.psfhosted.org> |
2021-06-22 12:57:06 | ronserruya2 | link | issue44489 messages |
2021-06-22 12:57:06 | ronserruya2 | create | |
|