switch from log to tracing

I think this is a big improvement in readability.

I removed the `lnav` config, which is a little sad, but I don't think it
supports this structured logging format well. Still seems worthwhile on
balance.
This commit is contained in:
Scott Lamb
2023-02-15 23:14:54 -08:00
parent db2e0f1d39
commit ebcdd76084
38 changed files with 632 additions and 344 deletions

View File

@@ -16,9 +16,9 @@ path = "lib.rs"
failure = "0.1.1"
futures = "0.3"
libc = "0.2"
log = "0.4"
nom = "7.0.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
slab = "0.4"
time = "0.1"
tracing = "0.1.37"

View File

@@ -5,13 +5,13 @@
//! Clock interface and implementations for testability.
use failure::Error;
use log::warn;
use std::mem;
use std::sync::Mutex;
use std::sync::{mpsc, Arc};
use std::thread;
use std::time::Duration as StdDuration;
use time::{Duration, Timespec};
use tracing::warn;
use crate::shutdown::ShutdownError;
@@ -54,9 +54,8 @@ where
shutdown_rx.check()?;
let sleep_time = Duration::seconds(1);
warn!(
"sleeping for {} after error: {}",
sleep_time,
crate::error::prettify_failure(&e)
err = crate::error::prettify_failure(&e),
"sleeping for 1 s after error"
);
clocks.sleep(sleep_time);
}