Compare commits
7 Commits
Author | SHA1 | Date |
---|---|---|
Michael Pfaff | 84c3cada2c | |
Michael Pfaff | cec213adda | |
Michael Pfaff | 25b876ec0c | |
Michael Pfaff | 68e356811a | |
Michael Pfaff | c269c55cab | |
Michael Pfaff | 918577455e | |
Michael Pfaff | 0db36d48cc |
|
@ -1,13 +1,13 @@
|
|||
[package]
|
||||
name = "tide_tracing"
|
||||
version = "0.6.0"
|
||||
version = "0.6.3"
|
||||
authors = ["Michael Pfaff <michael@pfaff.dev>"]
|
||||
edition = "2021"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
nrid = { git = "https://git.pfaff.dev/michael/nrid.rs.git", tag = "v0.2.0", default-features = false }
|
||||
tide = "0.16"
|
||||
tide = { version = "0.16", default-features = false }
|
||||
tracing = "0.1"
|
||||
async-trait = "0.1"
|
||||
num_enum = "0.5"
|
||||
|
|
10
src/lib.rs
10
src/lib.rs
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue