(金庆的专栏 2021.11)
slog 不是立即写盘,最后的几行日志会丢失
slog 不支持运行中动态更改日志等级
tracing with_filter_reloading()
slog 不支持不同包设置不同日志等级
发现一次 slog panic: panicked at 'slog::Fuse Drain: Fatal(Custom { kind: BrokenPipe, error: "The logger thread terminated" })'
panicked at 'slog::Fuse Drain: Fatal(Custom { kind: BrokenPipe, error: "The logger thread terminated" })'
搜到相同错误:https://github.com/mimblewimble/grin/issues/946
slog 主页10月添加推荐使用 tracing
slog 按线程保存上下文,tracing 按协程保存上下文
tracing github star 1.9K > slog 1.2K
tracing crates 下载 21M > sloggers 0.4M, slog-scope 2.6M, slog-stdlog 1.9M
tracing vs slog: https://www.reddit.com/r/rust/comments/kdo29n/slog_vs_tracing_which_one_do_you_prefer/
Rust compiler 2020年已改用 tracing:https://github.com/rust-lang/rust/pull/74726
tracing 更好用
Powered by: C++博客 Copyright © 金庆