mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-28 00:00:20 +02:00
Use env!("CARGO_CRATE_NAME") in the example to simplify the tracing setup code (#2884)
This commit is contained in:
@@ -25,7 +25,11 @@ async fn main() {
|
||||
tracing_subscriber::EnvFilter::try_from_default_env().unwrap_or_else(|_| {
|
||||
// axum logs rejections from built-in extractors with the `axum::rejection`
|
||||
// target, at `TRACE` level. `axum::rejection=trace` enables showing those events
|
||||
"example_tracing_aka_logging=debug,tower_http=debug,axum::rejection=trace".into()
|
||||
format!(
|
||||
"{}=debug,tower_http=debug,axum::rejection=trace",
|
||||
env!("CARGO_CRATE_NAME")
|
||||
)
|
||||
.into()
|
||||
}),
|
||||
)
|
||||
.with(tracing_subscriber::fmt::layer())
|
||||
|
||||
Reference in New Issue
Block a user