logging: explain _overrideLoglevel in initLogging
@@ -141,6 +141,10 @@ def initLogging():
logging.getLogger('tensorflow').setLevel(logging.ERROR)
if _overrideLogLevel:
+ # for existing loggers that won't have getLogger do this
+ # (because they were instantiated through logging.getLogger
+ # instead of ours, or come from logging.config.fileConfig),
+ # unset log levels so the global override can apply:
for loggerName in logging.Logger.manager.loggerDict:
logger = logging.Logger.manager.loggerDict[loggerName]
if isinstance(logger, logging.PlaceHolder):
