pub fn init_logging_with_audit(
level: &str,
audit_path: Option<&Path>,
) -> Result<Option<WorkerGuard>>Expand description
初始化日志 + 可选的 audit JSONL 文件
- 常规事件走 stderr(与
init_logging_with_level一致) - 如果
audit_path传了,额外加一个 JSON 层,只捕获target = "futu_audit"的 事件并写到文件 / 目录。返回的WorkerGuard必须保留到进程退出,否则 tracing-appender 的后台线程可能丢事件。 - 传
None时返回Ok(None),等价于init_logging_with_level。