[openstack-dev] [oslo] Austin summit session recap(s)
Doug Hellmann
doug at doughellmann.com
Thu May 12 17:49:47 UTC 2016
Excerpts from Alexis Lee's message of 2016-05-12 10:22:29 +0100:
> Doug Hellmann said on Wed, May 11, 2016 at 08:45:16AM -0400:
> > Yes, handler, sorry.
> >
> > I thought they were only unconfigured if the flag was set to do that,
> > and that your patch had the disable_existing_loggers flag set to not do
> > it? Maybe I misunderstood the full meaning of the flag, though, and it
> > only affects loggers and not handlers?
>
> It only affects loggers. Here's the relevant part of logging:
>
> 183 def _install_loggers(cp, handlers, disable_existing_loggers):
> ...
> 259 #Disable any old loggers. There's no point deleting
> 260 #them as other threads may continue to hold references
> 261 #and by disabling them, you stop them doing any logging.
> 262 #However, don't disable children of named loggers, as that's
> 263 #probably not what was intended by the user.
> 264 for log in existing:
> 265 logger = root.manager.loggerDict[log]
> 266 if log in child_loggers:
> 267 logger.level = logging.NOTSET
> 268 logger.handlers = []
> 269 logger.propagate = 1
> 270 else:
> 271 logger.disabled = disable_existing_loggers
>
> The issue I mentioned is that non-child loggers aren't reset if
> disable_existing_loggers is False. It's easy enough to work around that
> though, new patchset is up.
OK, good. I'll stop worrying about this case and go look at your code. :-)
Doug
More information about the OpenStack-dev
mailing list