增加rjson非0的堆栈日志
This commit is contained in:
parent
c6f565bcdf
commit
c26682e19b
@ -42,11 +42,11 @@ def ReJson(code: int, body: [dict, list] = None, msg: str = None, error: str = N
|
||||
stack = traceback.extract_stack()
|
||||
project_stack = [frame for frame in stack if "pywxdump" in frame.filename.lower() and
|
||||
any(keyword in frame.filename for keyword in
|
||||
["api", "db", "wx_core", "analyzer", "ui"])]
|
||||
["api", "db", "wx_core", "analyzer", "ui", "cli", "server"])]
|
||||
# 格式化调用栈信息
|
||||
formatted_stack = ''.join(traceback.format_list(project_stack))
|
||||
# stack_trace = ''.join(traceback.format_stack())
|
||||
loger_rjson.warning(f"\n{code=}\nbody=\n{rjson['body']}\nmsg={rjson['msg']}\n{extra=}\n{formatted_stack}")
|
||||
loger_rjson.warning(f"\n{code=}\n{rjson['body']=}\n{rjson['msg']=}\n{rjson['extra']=}\n{formatted_stack}")
|
||||
if error:
|
||||
loger_rjson.error(error, exc_info=True)
|
||||
return rjson
|
||||
|
@ -99,7 +99,7 @@ def error9999(func):
|
||||
traceback_data = traceback.format_exc()
|
||||
rdata = f"{traceback_data}"
|
||||
# logging.error(rdata)
|
||||
return ReJson(9999, body=rdata)
|
||||
return ReJson(9999, body=f"{str(e)}\n{rdata}", error=str(e))
|
||||
|
||||
return wrapper
|
||||
|
||||
|
@ -124,7 +124,6 @@ class DatabaseBase(DatabaseSingletonBase):
|
||||
finally:
|
||||
connection.close()
|
||||
|
||||
|
||||
def check_tables_exist(self, required_tables):
|
||||
"""
|
||||
判断该类所需要的表是否存在
|
||||
|
Loading…
Reference in New Issue
Block a user