mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-28 13:42:37 +01:00
main/coreplugin: use log.exception() instead of traceback.print_exc()
This fixes tracebacks only being sent to console, and not the log file.
This commit is contained in:
parent
61804b1ecd
commit
536366de99
@ -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')
|
||||
|
3
main.py
3
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):
|
||||
|
Loading…
Reference in New Issue
Block a user