From 6c35aed7677dad1f92491d227aec2c946b36e6f1 Mon Sep 17 00:00:00 2001 From: Thor77 Date: Mon, 27 Feb 2017 12:40:30 +0100 Subject: [PATCH] Only log to file if not logging to stdout --- tsstats/__main__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tsstats/__main__.py b/tsstats/__main__.py index b364e0c..2fa648a 100644 --- a/tsstats/__main__.py +++ b/tsstats/__main__.py @@ -77,10 +77,11 @@ def main(configuration): logger.setLevel(logging.DEBUG) if configuration.getboolean('General', 'debugstdout'): stream_handler.setLevel(logging.DEBUG) + else: + logger.addHandler(file_handler) # attach handlers logger.addHandler(stream_handler) - logger.addHandler(file_handler) idmap = configuration.get('General', 'idmap') if idmap: