From fdbb872fc3ee55b59ae87092dea2dfee29834675 Mon Sep 17 00:00:00 2001 From: n08i40k Date: Sat, 6 Sep 2025 20:17:14 +0400 Subject: [PATCH] refactor(dev): move tracing to feature --- Cargo.toml | 12 ++++++++---- src/test_env.rs | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e2a3290..4c17a9f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,9 @@ publish = false [profile.release] debug = true +[features] +trace = ["tracing", "console-subscriber"] + [dependencies] providers = { path = "providers" } actix-macros = { path = "actix-macros" } @@ -69,9 +72,10 @@ base64 = "0.22.1" percent-encoding = "2.3.2" ed25519-dalek = "3.0.0-pre.0" +# development tracing +console-subscriber = { version = "0.4.1", optional = true } +tracing = { version = "0.1.41", optional = true } + [dev-dependencies] providers = { path = "providers", features = ["test"] } -actix-test = { path = "actix-test" } - -console-subscriber = "0.4.1" -tracing = "0.1.41" +actix-test = { path = "actix-test" } \ No newline at end of file diff --git a/src/test_env.rs b/src/test_env.rs index 82ebbd9..4f65f4f 100644 --- a/src/test_env.rs +++ b/src/test_env.rs @@ -26,7 +26,7 @@ pub(crate) mod tests { STATE .get_or_init(async || -> web::Data { - #[cfg(all(test, tokio_unstable))] + #[cfg(feature = "trace")] console_subscriber::init(); new_app_state(None).await.unwrap()