debug(audit): 添加X光调试-追踪断点
This commit is contained in:
@ -319,6 +319,8 @@ def audit_log(module: str, action: str = None, get_target_id_fn=None, get_target
|
||||
break
|
||||
|
||||
# 保存日志(统一入库)
|
||||
print(f"📥 [X光-装饰器] 准备入库! details: {details}, g.audit_details: {getattr(g, 'audit_details', 'NOT_FOUND')}")
|
||||
|
||||
log_entry = AuditLog(
|
||||
user_id=user_id,
|
||||
username=username,
|
||||
@ -338,6 +340,9 @@ def audit_log(module: str, action: str = None, get_target_id_fn=None, get_target
|
||||
db.session.commit()
|
||||
|
||||
except Exception as e:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
print(f"💥 [X光-崩溃] 审计入库失败原因: {str(e)}")
|
||||
current_app.logger.error(f"审计日志记录失败: {str(e)}")
|
||||
db.session.rollback()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user