From e6f0a86c5a9c32e084c16e0b32f603354afd3007 Mon Sep 17 00:00:00 2001 From: redfish Date: Thu, 2 Aug 2018 23:40:44 +0000 Subject: [PATCH] main: logging: do not override the warn level This fixes the very annoying problem where the log messages with level WARNING are not printed, while log messages with lower level INFO are printed. This is very confusing behavior and should be avoided. This was due to this override. If there is too much logging output in debug mode, then let's deescalate the level of the frequently-printed log messages down to DEBUG level. --- src/main.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main.py b/src/main.py index 469e27fc..b0f1a326 100644 --- a/src/main.py +++ b/src/main.py @@ -48,9 +48,6 @@ if not os.path.isfile("%s/sites.json" % config.data_dir): if not os.path.isfile("%s/users.json" % config.data_dir): open("%s/users.json" % config.data_dir, "w").write("{}") -# Setup logging -logging.WARNING = 15 # Don't display warnings if not in debug mode -logging.addLevelName(15, "WARNING") if config.action == "main": from util import helper log_file_path = "%s/debug.log" % config.log_dir