diff --git a/plugins/log.py b/plugins/log.py index aec84ad..dd528e9 100644 --- a/plugins/log.py +++ b/plugins/log.py @@ -101,11 +101,8 @@ def log(bot, input): if beau == '': # don't log this return - try: - print '%s %s %s' % (timestamp, input.chan, beau) - except Exception, e: - print e, timestamp, input.chan, beau - if input.chan: fd = get_log_fd(bot.persist_dir, input.server, input.chan) fd.write(timestamp + ' ' + beau + '\n') + + print u'%s %s %s' % (timestamp, input.chan, beau) diff --git a/plugins/util/hook.py b/plugins/util/hook.py index c4e0445..f6e257a 100644 --- a/plugins/util/hook.py +++ b/plugins/util/hook.py @@ -1,6 +1,6 @@ import Queue import thread - +import traceback def _isfunc(x): if type(x) == type(_isfunc): @@ -84,7 +84,10 @@ def tee(func, **kwargs): input = func._iqueue.get() if input == StopIteration: return - func(*input) + try: + func(*input) + except Exception: + traceback.print_exc(Exception) thread.start_new_thread(trampoline, (func,))