| Store | Cart

Re: Finding all loggers?

From: Michael Hrivnak <mhri...@hrivnak.org>
Thu, 14 Jun 2012 17:38:00 -0400
>>> 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>}


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

Recent Messages in this Thread
Roy Smith Jun 14, 2012 09:03 pm
Michael Hrivnak Jun 14, 2012 09:38 pm
Roy Smith Jun 14, 2012 10:57 pm
Messages in this thread