From 91392c721f2c918d427469272be38d98258ba206 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sat, 28 Dec 2013 16:31:42 +0100 Subject: =?UTF-8?q?Fix=20#2414=20(don=E2=80=99t=20use=20/tmp/dummy=20in=20?= =?UTF-8?q?the=20logging=20config)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config.py | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/config.py b/src/config.py index 5f07cc80..9c3d6cbf 100644 --- a/src/config.py +++ b/src/config.py @@ -306,18 +306,6 @@ LOGGING_CONFIG = { } }, 'handlers': { - 'debug':{ - 'level':'DEBUG', - 'class':'logging.FileHandler', - 'filename': '/tmp/dummy', - 'formatter': 'simple', - }, - 'error': { - 'level': 'ERROR', - 'class': 'logging.FileHandler', - 'filename': '/tmp/dummy', - 'formatter': 'simple', - }, }, 'root': { 'handlers': [], @@ -327,13 +315,22 @@ LOGGING_CONFIG = { } if config.get('log_errors', 'true').lower() != 'false': LOGGING_CONFIG['root']['handlers'].append('error') - LOGGING_CONFIG['handlers']['error']['filename'] = path.join( - LOG_DIR, - 'errors.log') + LOGGING_CONFIG['handlers']['error'] = { + 'level': 'ERROR', + 'class': 'logging.FileHandler', + 'filename': path.join(LOG_DIR, 'errors.log'), + 'formatter': 'simple', + } if options.debug: LOGGING_CONFIG['root']['handlers'].append('debug') - LOGGING_CONFIG['handlers']['debug']['filename'] = options.debug + LOGGING_CONFIG['handlers']['debug'] = { + 'level':'DEBUG', + 'class':'logging.FileHandler', + 'filename': options.debug, + 'formatter': 'simple', + } + if LOGGING_CONFIG['root']['handlers']: logging.config.dictConfig(LOGGING_CONFIG) -- cgit v1.2.3