diff options
Diffstat (limited to 'bot/__init__.py')
-rw-r--r-- | bot/__init__.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/bot/__init__.py b/bot/__init__.py index 8cbcd121..c2ea4ba0 100644 --- a/bot/__init__.py +++ b/bot/__init__.py @@ -1,8 +1,8 @@ -import os import logging.handlers +import os -# set up logging +# set up logging log_dir = 'log' log_file = log_dir + os.sep + 'hackbot.log' os.makedirs(log_dir, exist_ok=True) @@ -22,9 +22,14 @@ if root.handlers: for handler in root.handlers: root.removeHandler(handler) -# setup new logging configuration -logging.basicConfig(format='%(asctime)s - %(name)s %(levelname)s: %(message)s', datefmt="%D %H:%M:%S", - level=logging.DEBUG, - handlers=[console_handler, file_handler]) +# Silence irrelevant loggers +logging.getLogger("discord").setLevel(logging.ERROR) -logging.info('Logging Process Started')
\ No newline at end of file +# setup new logging configuration +logging.basicConfig( + format='%(asctime)s - %(name)s %(levelname)s: %(message)s', + datefmt="%D %H:%M:%S", + level=logging.DEBUG, + handlers=[console_handler, file_handler] +) +logging.getLogger().info('Logging initialization complete') |