>>> import logging >>> logging.Logger.manager.loggerDict {} >>> logging.getLogger('foo') <logging.Logger object at 0x7f11d4d104d0> >>> logging.getLogger('bar') <logging.Logger object at 0x7f11d4cb7ad0> >>> logging.Logger.manager.loggerDict {'foo': <logging.Logger object at 0x7f11d4d104d0>, 'bar': <logging.Logger object at 0x7f11d4cb7ad0>}
Enjoy, Michael On Thu, Jun 14, 2012 at 5:03 PM, Roy Smith <r...@panix.com> wrote: > Is there any way to get a list of all the loggers that have been > defined? So if somebody has done: > > from logging import getLogger > getLogger("foo") > getLogger("foo.bar") > getLogger("baz") > > I want something which will give me back ["foo", "foo.bar", "baz"]. > -- > http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list