init_logging_with_audit

Function init_logging_with_audit 

Source
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