Compare commits

...

5 Commits

2 changed files with 9 additions and 3 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "tide_tracing"
version = "0.6.1"
version = "0.6.3"
authors = ["Michael Pfaff <michael@pfaff.dev>"]
edition = "2021"
license = "MIT OR Apache-2.0"

View File

@ -1,5 +1,4 @@
#![feature(const_trait_impl)]
#![feature(const_fn_trait_bound)]
#[macro_use]
extern crate tracing;
@ -189,7 +188,14 @@ impl LogMiddleware {
async move {
let res = next.run(req).await;
let status = res.status();
debug!(status = %status, "Response");
match res.error() {
Some(e) => {
error!(status = %status, "Response with internal error: {e:?}");
}
None => {
debug!(status = %status, "Response");
}
}
Ok(res)
}
.instrument(span)