(金慶的專欄 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 © 金慶