(logs)
| 147 | } |
| 148 | try: |
| 149 | def modifier(logs): |
| 150 | if logs is None: |
| 151 | logs = [] |
| 152 | logs.append(entry) |
| 153 | if len(logs) > MAX_AUDIT_LOG: |
| 154 | logs = logs[-MAX_AUDIT_LOG:] |
| 155 | return logs |
| 156 | atomic_json_update(AUDIT_FILE, modifier, []) |
| 157 | except Exception as e: |
| 158 | log.warning(f"审计日志写入失败: {e}") |
no test coverage detected