def char_parse_exception(error_object, *args, ch): # Parser for exceptions with a CH entity for extra msging
merc.GDF = False
wrap_call = inspect.getinnerframes(sys.exc_info()[2])
if ch.level == merc.ML:
ch.send("An Exception Occurred: \n%s %s\n\n" % (type(error_object), str(error_object)))
logger.debug("Exception: %s %s" % (type(error_object), str(error_object)))
for call_info in reversed(wrap_call):
local_calls = call_info[0].f_locals
if '_logged__tracer_var_' in local_calls:
continue
if ch.level == merc.ML:
ch.send("--Frame Trace-- \nFile: %s \nFunction: %s \nLine: %d \nCode: %s "
% (call_info[1], call_info[3], call_info[2], call_info[4][0].lstrip()))
ch.send("\n")
logger.debug("--Frame Trace-- \nFile: %s \nFunction: %s \nLine: %d \nCode: %s "
% (call_info[1], call_info[3], call_info[2], call_info[4][0].lstrip()))
logger.debug("Local Env Variables: ")
for k, v in local_calls.items():
levtrace = value_to_str(v)
logger.debug("%s : %s", k, levtrace)
评论列表
文章目录