Disable unused logging levels, makes logging.debug about 25 times faster.

This commit is contained in:
Emmanuel Gil Peyrot 2016-07-30 00:51:33 +01:00
parent aed82a0e3b
commit ae51999a6f

View file

@ -620,6 +620,7 @@ def setup_logging():
'filename': path.join(LOG_DIR, 'errors.log'),
'formatter': 'simple',
}
logging.disable(logging.WARNING)
if options.debug:
LOGGING_CONFIG['root']['handlers'].append('debug')
@ -629,11 +630,13 @@ def setup_logging():
'filename': options.debug,
'formatter': 'simple',
}
logging.disable(logging.NOTSET)
if LOGGING_CONFIG['root']['handlers']:
logging.config.dictConfig(LOGGING_CONFIG)
else:
logging.disable(logging.ERROR)
logging.basicConfig(level=logging.CRITICAL)
global log