From ae51999a6f004cfc20f5eb3b4ce289136193d779 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 30 Jul 2016 00:51:33 +0100 Subject: Disable unused logging levels, makes logging.debug about 25 times faster. --- poezio/config.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'poezio') diff --git a/poezio/config.py b/poezio/config.py index 85fc5750..91e82268 100644 --- a/poezio/config.py +++ b/poezio/config.py @@ -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 -- cgit v1.2.3