Fixed logging issues without hook

This commit is contained in:
Adriene Hutchins 2020-03-21 12:18:21 -04:00
parent b87d724c35
commit b9c017d6c5
2 changed files with 10 additions and 12 deletions

1
.gitignore vendored
View file

@ -55,3 +55,4 @@ coverage.xml
# Sphinx documentation
docs/_build/
extensions/__pycache__/core.cpython-38.pyc

View file

@ -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: