13

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.

  1. [caveat] I already know how to clear one handler.
  2. [caveat] I would prefer stdlib over 3rd-party libs (pypi, github, et al).
Community
  • 1
  • 1
bitcycle
  • 7,632
  • 16
  • 70
  • 121

1 Answers1

15
print (logging.Logger.manager.loggerDict.keys())

found by digging the sources of logging package

plaes
  • 31,788
  • 11
  • 91
  • 89
nosklo
  • 217,122
  • 57
  • 293
  • 297