From acecd17df2ceabf75faf1415d69fd1fec922f64c Mon Sep 17 00:00:00 2001 From: Thor77 Date: Mon, 22 Jun 2015 16:38:42 +0200 Subject: [PATCH] add debug_file option and set debug-default to false --- tsstats.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tsstats.py b/tsstats.py index 776585c..9d85c45 100755 --- a/tsstats.py +++ b/tsstats.py @@ -129,15 +129,15 @@ if not ('logfile' in general or 'outputfile' in general): raise Exception('Invalid config! "logfile" and/or "outputfile" missing!') log_path = general['logfile'] output_path = general['outputfile'] -debug = general.get('debug', 'true') in ['true', 'True'] +debug = general.get('debug', 'false') in ['true', 'True'] +debug_file = general.get('debugfile', str(debug)) in ['true', 'True'] title = html.get('title', 'TeamspeakStats') # setup logging log = logging.getLogger() -log.setLevel(logging.DEBUG) # create handler -if debug: +if debug and debug_file: file_handler = logging.FileHandler('debug.txt', 'w', 'UTF-8') file_handler.setFormatter(logging.Formatter('%(message)s')) file_handler.setLevel(logging.DEBUG)