From b9c017d6c52106c4b3cda84cde4ff1d68273c804 Mon Sep 17 00:00:00 2001 From: Adriene Hutchins Date: Sat, 21 Mar 2020 12:18:21 -0400 Subject: [PATCH] Fixed logging issues without hook --- .gitignore | 1 + extensions/utils/logging.py | 21 +++++++++------------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index d41efc8..ad92649 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,4 @@ coverage.xml # Sphinx documentation docs/_build/ +extensions/__pycache__/core.cpython-38.pyc diff --git a/extensions/utils/logging.py b/extensions/utils/logging.py index 88a2560..b0b8d23 100644 --- a/extensions/utils/logging.py +++ b/extensions/utils/logging.py @@ -22,28 +22,25 @@ class Logging(): # Sets info hook first self.info_hook = self.online.get_webhook( - bot.config['HOOKS']['INFO_HOOK'] - if bot.config['HOOKS']['INFO_HOOK'] + bot.config['HOOKS']['INFO_HOOK']) \ + if bot.config['HOOKS']['INFO_HOOK'] \ else None - ) + # Sets other hooks or defaults them if self.info_hook: self.warn_hook = self.online.get_webhook( - bot.config['HOOKS']['WARN_HOOK'] - if bot.config['HOOKS']['WARN_HOOK'] + bot.config['HOOKS']['WARN_HOOK']) \ + if bot.config['HOOKS']['WARN_HOOK'] \ else self.info_hook - ) self.error_hook = self.online.get_webhook( - bot.config['HOOKS']['ERROR_HOOK'] - if bot.config['HOOKS']['ERROR_HOOK'] + bot.config['HOOKS']['ERROR_HOOK']) \ + if bot.config['HOOKS']['ERROR_HOOK'] \ else self.info_hook - ) self.debug_hook = self.online.get_webhook( - bot.config['HOOKS']['DEBUG_HOOK'] - if bot.config['HOOKS']['DEBUG_HOOK'] + bot.config['HOOKS']['DEBUG_HOOK']) \ + if bot.config['HOOKS']['DEBUG_HOOK'] \ else self.info_hook - ) # If no hooks, nothing is there else: