Commit cd7973085011
tarball2 files changed+6-1
@@ -154,6 +154,11 @@ fn main() -> ExitCode {
154154
if let Some(p) = &log_path {155155
tracing::info!(path = %p.display(), "logging to a file");156156
}157
+ let default_hook = std::panic::take_hook();158
+ std::panic::set_hook(Box::new(move |info| {159
+ tracing::error!("{info}");160
+ default_hook(info);161
+ }));157162
#[cfg(feature = "spans")]158163
tracing::info!("logging spans slower than {threshold_us} us");159164
match run(config, backend, &program) {@@ -42,7 +42,7 @@ where
4242
let took = at.elapsed();4343
if took.as_micros() >= self.threshold_us {4444
let path: Vec<&str> = span.scope().from_root().map(|s| s.name()).collect();45
- eprintln!("slow span {} took_us={}", path.join(">"), took.as_micros());45
+ tracing::info!("slow span {} took_us={}", path.join(">"), took.as_micros());4646
}4747
}4848
}