Skip to content

Commit

Permalink
fix: handle log crate's loggings through slog_scope (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
jopemachine authored Feb 18, 2024
1 parent 2e02abb commit 56d53b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions examples/riteraft-memstore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ slog-async = "2"
slog-term = "2"
slog = "2"
slog-stdlog = "4"
slog-scope = "4.4"
structopt = "0.3"
tokio = { version = "1", features = ["full"] }
3 changes: 2 additions & 1 deletion examples/riteraft-memstore/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ async fn main() -> std::result::Result<(), Box<dyn std::error::Error>> {
let logger = slog::Logger::root(drain, slog_o!("version" => env!("CARGO_PKG_VERSION")));

// converts log to slog
let _log_guard = slog_stdlog::init().unwrap();
let _scope_guard = slog_scope::set_global_logger(logger.clone());
let _log_guard = slog_stdlog::init_with_level(log::Level::Debug).unwrap();

let options = Options::from_args();
let store = HashStore::new();
Expand Down

0 comments on commit 56d53b4

Please sign in to comment.