def log_callstack_last(back_trace=False):
if not back_trace:
stack = traceback.extract_stack()[:-1]
else:
stack = traceback.extract_tb(sys.exc_info()[2])
message = "empty"
print("Parsing stack")
for path, line, func, code in stack:
print(path,func)
if func not in BACKTRACE_FILTER_FUNC:
if func not in BACKTRACE_FILTER_HIDE_CODE:
file = os.path.split(path)[-1]
message = "%s:%s" % (file, line)
return message
评论列表
文章目录