From: CMDR furrycat Date: Wed, 26 Oct 2016 20:04:17 +0000 (+0100) Subject: Tidy exception printing. X-Git-Url: http://git.furryclan.net/?a=commitdiff_plain;h=0c068713af4b9ac0ea54f1a62b849a84360b8c2f;p=furrycat%2Fcatbot.git Tidy exception printing. --- diff --git a/bot.py b/bot.py index 8ee3851..d6de40e 100644 --- a/bot.py +++ b/bot.py @@ -127,7 +127,7 @@ def set_avatar(url): return True except: fd.close() - logging.exception("set_avatar") + log.exception("set_avatar") return False @asyncio.coroutine diff --git a/plugins/__init__.py b/plugins/__init__.py index 9b7d187..01a3d6d 100644 --- a/plugins/__init__.py +++ b/plugins/__init__.py @@ -34,7 +34,7 @@ class Plugins(object): module.log = logging.getLogger(name) self.loaded[name] = { 'module': module, 'plugin': getattr(module, plugin)() } except: - logging.exception('refresh') + log.exception('refresh') def plugins(self): return self.loaded.keys() diff --git a/plugins/announcements.py b/plugins/announcements.py index 7625880..48c1842 100644 --- a/plugins/announcements.py +++ b/plugins/announcements.py @@ -842,4 +842,4 @@ class Announcements(DBConnection): log.info('Playing announcement {} {} in {}'.format(announcement['id'], filename, channel)) yield from bot.play_sound(client.get_channel(str(announcement['voice_id'])), filename) except: - logging.exception("announce") + log.exception("announce") diff --git a/plugins/feeds.py b/plugins/feeds.py index b8953c7..da5ff63 100644 --- a/plugins/feeds.py +++ b/plugins/feeds.py @@ -3,7 +3,6 @@ import bs4 import discord import feedparser import json -import logging import multiprocessing import re import shlex @@ -146,7 +145,7 @@ class Feeds(DBConnection): except ValueError: log.error('Invalid link_json in feed {}'.format(feed['url'])) except: - logging.exception('do_rss:link_json') + log.exception('do_rss:link_json') if not link: log.warning('No link for entry {}'.format(entry['title'])) continue @@ -168,7 +167,7 @@ class Feeds(DBConnection): digests.append(digest) log.debug('Posted RSS with digest {}'.format(digest)) except: - logging.exception("do_rss") + log.exception("do_rss") @asyncio.coroutine def on_ready(self):