mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-27 21:19:31 +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
|
## coreplugin.py - Core PyLink plugin
|
||||||
|
|
||||||
import traceback
|
|
||||||
|
|
||||||
import utils
|
import utils
|
||||||
from log import log
|
from log import log
|
||||||
|
|
||||||
@ -33,7 +31,7 @@ def handle_commands(irc, source, command, args):
|
|||||||
try:
|
try:
|
||||||
func(irc, source, cmd_args)
|
func(irc, source, cmd_args)
|
||||||
except Exception as e:
|
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)))
|
utils.msg(irc, source, 'Uncaught exception in command %r: %s: %s' % (cmd, type(e).__name__, str(e)))
|
||||||
return
|
return
|
||||||
utils.add_hook(handle_commands, 'PRIVMSG')
|
utils.add_hook(handle_commands, 'PRIVMSG')
|
||||||
|
3
main.py
3
main.py
@ -7,7 +7,6 @@ import time
|
|||||||
import sys
|
import sys
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
import threading
|
import threading
|
||||||
import traceback
|
|
||||||
|
|
||||||
from log import log
|
from log import log
|
||||||
import conf
|
import conf
|
||||||
@ -152,7 +151,7 @@ class Irc():
|
|||||||
hook_func(self, numeric, command, parsed_args)
|
hook_func(self, numeric, command, parsed_args)
|
||||||
except Exception:
|
except Exception:
|
||||||
# We don't want plugins to crash our servers...
|
# We don't want plugins to crash our servers...
|
||||||
traceback.print_exc()
|
log.exception('Unhandled exception caught in %r' % hook_func)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
def send(self, data):
|
def send(self, data):
|
||||||
|
Loading…
Reference in New Issue
Block a user