diff options
| author | 2018-10-11 12:21:46 +0200 | |
|---|---|---|
| committer | 2018-10-11 12:21:46 +0200 | |
| commit | f51e7a3bc7517ff6843a6fea28c9772d262e970e (patch) | |
| tree | a800567d389918002f97a31ee9348658e7d3ce18 /bot/__init__.py | |
| parent | Merge pull request #34 from markylon/master (diff) | |
| parent | Made the movie formatter less naïve. It no longer crashes if TMDB's return d... (diff) | |
Merge pull request #41 from discord-python/fixup
Various critical fixes.
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') |