This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ronserruya2
Recipients ronserruya2
Date 2021-06-22.12:57:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1624366626.62.0.782556758458.issue44489@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2021-06-22 12:57:06ronserruya2setrecipients: + ronserruya2
2021-06-22 12:57:06ronserruya2setmessageid: <1624366626.62.0.782556758458.issue44489@roundup.psfhosted.org>
2021-06-22 12:57:06ronserruya2linkissue44489 messages
2021-06-22 12:57:06ronserruya2create