diff options
author | mathieui <mathieui@mathieui.net> | 2013-12-28 16:31:42 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2013-12-28 16:31:42 +0100 |
commit | 91392c721f2c918d427469272be38d98258ba206 (patch) | |
tree | bd59aff37b3b612c06fbeb46e2c8102cdab2f551 /src/config.py | |
parent | 6461a77f295219c6cfb9fa918cedde1480111ebd (diff) | |
download | poezio-91392c721f2c918d427469272be38d98258ba206.tar.gz poezio-91392c721f2c918d427469272be38d98258ba206.tar.bz2 poezio-91392c721f2c918d427469272be38d98258ba206.tar.xz poezio-91392c721f2c918d427469272be38d98258ba206.zip |
Fix #2414 (don’t use /tmp/dummy in the logging config)
Diffstat (limited to 'src/config.py')
-rw-r--r-- | src/config.py | 29 |
1 files changed, 13 insertions, 16 deletions
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) |