diff --git a/coreplugin.py b/coreplugin.py index b6c0712..7fc9b83 100644 --- a/coreplugin.py +++ b/coreplugin.py @@ -1,7 +1,5 @@ ## coreplugin.py - Core PyLink plugin -import traceback - import utils from log import log @@ -33,7 +31,7 @@ def handle_commands(irc, source, command, args): try: func(irc, source, cmd_args) except Exception as e: - traceback.print_exc() + log.exception('Unhandled exception caught in command %r' % cmd) utils.msg(irc, source, 'Uncaught exception in command %r: %s: %s' % (cmd, type(e).__name__, str(e))) return utils.add_hook(handle_commands, 'PRIVMSG') diff --git a/main.py b/main.py index 7b8f8a5..6a74ae4 100755 --- a/main.py +++ b/main.py @@ -7,7 +7,6 @@ import time import sys from collections import defaultdict import threading -import traceback from log import log import conf @@ -152,7 +151,7 @@ class Irc(): hook_func(self, numeric, command, parsed_args) except Exception: # We don't want plugins to crash our servers... - traceback.print_exc() + log.exception('Unhandled exception caught in %r' % hook_func) continue def send(self, data):