Disable unused logging levels, makes logging.debug about 25 times faster.
This commit is contained in:
parent
aed82a0e3b
commit
ae51999a6f
1 changed files with 3 additions and 0 deletions
|
@ -620,6 +620,7 @@ def setup_logging():
|
||||||
'filename': path.join(LOG_DIR, 'errors.log'),
|
'filename': path.join(LOG_DIR, 'errors.log'),
|
||||||
'formatter': 'simple',
|
'formatter': 'simple',
|
||||||
}
|
}
|
||||||
|
logging.disable(logging.WARNING)
|
||||||
|
|
||||||
if options.debug:
|
if options.debug:
|
||||||
LOGGING_CONFIG['root']['handlers'].append('debug')
|
LOGGING_CONFIG['root']['handlers'].append('debug')
|
||||||
|
@ -629,11 +630,13 @@ def setup_logging():
|
||||||
'filename': options.debug,
|
'filename': options.debug,
|
||||||
'formatter': 'simple',
|
'formatter': 'simple',
|
||||||
}
|
}
|
||||||
|
logging.disable(logging.NOTSET)
|
||||||
|
|
||||||
|
|
||||||
if LOGGING_CONFIG['root']['handlers']:
|
if LOGGING_CONFIG['root']['handlers']:
|
||||||
logging.config.dictConfig(LOGGING_CONFIG)
|
logging.config.dictConfig(LOGGING_CONFIG)
|
||||||
else:
|
else:
|
||||||
|
logging.disable(logging.ERROR)
|
||||||
logging.basicConfig(level=logging.CRITICAL)
|
logging.basicConfig(level=logging.CRITICAL)
|
||||||
|
|
||||||
global log
|
global log
|
||||||
|
|
Loading…
Reference in a new issue