diff --git a/examples/chat/src/main.rs b/examples/chat/src/main.rs index 149ffe0d8a..05004c55e2 100644 --- a/examples/chat/src/main.rs +++ b/examples/chat/src/main.rs @@ -36,7 +36,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_chat=trace".into()), + .unwrap_or_else(|_| format!("{}=trace", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/compression/src/main.rs b/examples/compression/src/main.rs index 1fa1bb4976..1fe08b4bcf 100644 --- a/examples/compression/src/main.rs +++ b/examples/compression/src/main.rs @@ -12,7 +12,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example-compression=trace".into()), + .unwrap_or_else(|_| format!("{}=trace", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/consume-body-in-extractor-or-middleware/src/main.rs b/examples/consume-body-in-extractor-or-middleware/src/main.rs index 95714f3a3c..1a67f89629 100644 --- a/examples/consume-body-in-extractor-or-middleware/src/main.rs +++ b/examples/consume-body-in-extractor-or-middleware/src/main.rs @@ -22,7 +22,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_consume_body_in_extractor_or_middleware=debug".into()), + .unwrap_or_else(|_| format!("{}=debug", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/customize-extractor-error/src/main.rs b/examples/customize-extractor-error/src/main.rs index e8820326f9..0767d6d2ce 100644 --- a/examples/customize-extractor-error/src/main.rs +++ b/examples/customize-extractor-error/src/main.rs @@ -16,7 +16,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_customize_extractor_error=trace".into()), + .unwrap_or_else(|_| format!("{}=trace", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/customize-path-rejection/src/main.rs b/examples/customize-path-rejection/src/main.rs index 4231eabf60..c40931c6d1 100644 --- a/examples/customize-path-rejection/src/main.rs +++ b/examples/customize-path-rejection/src/main.rs @@ -20,7 +20,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_customize_path_rejection=debug".into()), + .unwrap_or_else(|_| format!("{}=debug", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/dependency-injection/src/main.rs b/examples/dependency-injection/src/main.rs index b8e1a451fa..c0dcd9f96a 100644 --- a/examples/dependency-injection/src/main.rs +++ b/examples/dependency-injection/src/main.rs @@ -25,7 +25,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_dependency_injection=debug".into()), + .unwrap_or_else(|_| format!("{}=debug", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/diesel-async-postgres/src/main.rs b/examples/diesel-async-postgres/src/main.rs index ee42ac1002..9d0d6673df 100644 --- a/examples/diesel-async-postgres/src/main.rs +++ b/examples/diesel-async-postgres/src/main.rs @@ -57,7 +57,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_diesel_async_postgres=debug".into()), + .unwrap_or_else(|_| format!("{}=trace", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/diesel-postgres/src/main.rs b/examples/diesel-postgres/src/main.rs index 605660d073..88e4c980b0 100644 --- a/examples/diesel-postgres/src/main.rs +++ b/examples/diesel-postgres/src/main.rs @@ -54,7 +54,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_tokio_postgres=debug".into()), + .unwrap_or_else(|_| format!("{}=debug", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/error-handling/src/main.rs b/examples/error-handling/src/main.rs index 6981f59eee..fd272fa1cc 100644 --- a/examples/error-handling/src/main.rs +++ b/examples/error-handling/src/main.rs @@ -46,7 +46,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_error_handling=debug,tower_http=debug".into()), + .unwrap_or_else(|_| format!("{}=debug,tower_http=debug", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/form/src/main.rs b/examples/form/src/main.rs index 3f9ed09560..e1b592ffe6 100644 --- a/examples/form/src/main.rs +++ b/examples/form/src/main.rs @@ -13,7 +13,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_form=debug".into()), + .unwrap_or_else(|_| format!("{}=debug", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/global-404-handler/src/main.rs b/examples/global-404-handler/src/main.rs index 38b029439b..d28b53bef9 100644 --- a/examples/global-404-handler/src/main.rs +++ b/examples/global-404-handler/src/main.rs @@ -17,7 +17,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_global_404_handler=debug".into()), + .unwrap_or_else(|_| format!("{}=debug", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/graceful-shutdown/src/main.rs b/examples/graceful-shutdown/src/main.rs index d3388c8359..985c0e1f4b 100644 --- a/examples/graceful-shutdown/src/main.rs +++ b/examples/graceful-shutdown/src/main.rs @@ -21,7 +21,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env().unwrap_or_else(|_| { - "example_graceful_shutdown=debug,tower_http=debug,axum=trace".into() + format!("{}=debug,tower_http=debug,axum=trace", module_path!()).into() }), ) .with(tracing_subscriber::fmt::layer().without_time()) diff --git a/examples/http-proxy/src/main.rs b/examples/http-proxy/src/main.rs index b60ed03daa..1137c393b2 100644 --- a/examples/http-proxy/src/main.rs +++ b/examples/http-proxy/src/main.rs @@ -37,7 +37,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_http_proxy=trace,tower_http=debug".into()), + .unwrap_or_else(|_| format!("{}=trace,tower_http=debug", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/jwt/src/main.rs b/examples/jwt/src/main.rs index 85211851b2..fafd3dbcc6 100644 --- a/examples/jwt/src/main.rs +++ b/examples/jwt/src/main.rs @@ -61,7 +61,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_jwt=debug".into()), + .unwrap_or_else(|_| format!("{}=debug", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/key-value-store/src/main.rs b/examples/key-value-store/src/main.rs index 1e2a5e748c..72282e1843 100644 --- a/examples/key-value-store/src/main.rs +++ b/examples/key-value-store/src/main.rs @@ -34,7 +34,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_key_value_store=debug,tower_http=debug".into()), + .unwrap_or_else(|_| format!("{}=debug,tower_http=debug", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/low-level-openssl/src/main.rs b/examples/low-level-openssl/src/main.rs index f2839d61a9..734858717c 100644 --- a/examples/low-level-openssl/src/main.rs +++ b/examples/low-level-openssl/src/main.rs @@ -15,7 +15,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_low_level_openssl=debug".into()), + .unwrap_or_else(|_| format!("{}=debug", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/low-level-rustls/src/main.rs b/examples/low-level-rustls/src/main.rs index 660225d7cf..e803dbf354 100644 --- a/examples/low-level-rustls/src/main.rs +++ b/examples/low-level-rustls/src/main.rs @@ -29,7 +29,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_low_level_rustls=debug".into()), + .unwrap_or_else(|_| format!("{}=debug", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/multipart-form/src/main.rs b/examples/multipart-form/src/main.rs index ecf5191f2a..f3519c8bbc 100644 --- a/examples/multipart-form/src/main.rs +++ b/examples/multipart-form/src/main.rs @@ -18,7 +18,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_multipart_form=debug,tower_http=debug".into()), + .unwrap_or_else(|_| format!("{}=debug,tower_http=debug", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/tls-graceful-shutdown/src/main.rs b/examples/tls-graceful-shutdown/src/main.rs index cc5b6ecb8d..27362b974d 100644 --- a/examples/tls-graceful-shutdown/src/main.rs +++ b/examples/tls-graceful-shutdown/src/main.rs @@ -28,7 +28,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_tls_graceful_shutdown=debug".into()), + .unwrap_or_else(|_| format!("{}=debug", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/tls-rustls/src/main.rs b/examples/tls-rustls/src/main.rs index 3649c75cb1..469d70e0a0 100644 --- a/examples/tls-rustls/src/main.rs +++ b/examples/tls-rustls/src/main.rs @@ -30,7 +30,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_tls_rustls=debug".into()), + .unwrap_or_else(|_| format!("{}=debug", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs index 2fdac41bd5..92313a7a44 100644 --- a/examples/todos/src/main.rs +++ b/examples/todos/src/main.rs @@ -37,7 +37,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_todos=debug,tower_http=debug".into()), + .unwrap_or_else(|_| format!("{}=debug,tower_http=debug", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/tokio-postgres/src/main.rs b/examples/tokio-postgres/src/main.rs index effc032089..01c9c23bb8 100644 --- a/examples/tokio-postgres/src/main.rs +++ b/examples/tokio-postgres/src/main.rs @@ -21,7 +21,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_tokio_postgres=debug".into()), + .unwrap_or_else(|_| format!("{}=debug", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/tokio-redis/src/main.rs b/examples/tokio-redis/src/main.rs index f0109f2127..d9fb4eda42 100644 --- a/examples/tokio-redis/src/main.rs +++ b/examples/tokio-redis/src/main.rs @@ -23,7 +23,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_tokio_redis=debug".into()), + .unwrap_or_else(|_| format!("{}=debug", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/tracing-aka-logging/src/main.rs b/examples/tracing-aka-logging/src/main.rs index 74a2055a07..b1f1a3ac9f 100644 --- a/examples/tracing-aka-logging/src/main.rs +++ b/examples/tracing-aka-logging/src/main.rs @@ -25,7 +25,7 @@ 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", module_path!()).into() }), ) .with(tracing_subscriber::fmt::layer()) diff --git a/examples/validator/src/main.rs b/examples/validator/src/main.rs index 85c4ac1843..4737156247 100644 --- a/examples/validator/src/main.rs +++ b/examples/validator/src/main.rs @@ -29,7 +29,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_validator=debug".into()), + .unwrap_or_else(|_| format!("{}=debug", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/versioning/src/main.rs b/examples/versioning/src/main.rs index a1d96e8340..6e10f7fc98 100644 --- a/examples/versioning/src/main.rs +++ b/examples/versioning/src/main.rs @@ -20,7 +20,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_versioning=debug".into()), + .unwrap_or_else(|_| format!("{}=debug", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init(); diff --git a/examples/websockets/src/main.rs b/examples/websockets/src/main.rs index 9c3b9dbbf5..39c1f5f7ed 100644 --- a/examples/websockets/src/main.rs +++ b/examples/websockets/src/main.rs @@ -46,7 +46,7 @@ async fn main() { tracing_subscriber::registry() .with( tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| "example_websockets=debug,tower_http=debug".into()), + .unwrap_or_else(|_| format!("{}=debug,tower_http=debug", module_path!()).into()), ) .with(tracing_subscriber::fmt::layer()) .init();