improve some error logs

...in particular, pass the error as a tracing param rather than directly
in the main error message. The new behavior is nicer with e.g.
OpenTelemetry.
This commit is contained in:
Scott Lamb
2023-08-03 15:42:41 -05:00
parent 9d07d24bc7
commit b9db9c11cc
12 changed files with 36 additions and 32 deletions

View File

@@ -99,7 +99,7 @@ impl Clocks for RealClocks {
fn sleep(&self, how_long: Duration) {
match how_long.to_std() {
Ok(d) => thread::sleep(d),
Err(e) => warn!("Invalid duration {:?}: {}", how_long, e),
Err(err) => warn!(%err, "invalid duration {:?}", how_long),
};
}