From 57d51d581d2b17a40aaff5f420aa659803b81099 Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Wed, 5 Feb 2025 11:26:10 +0000 Subject: [PATCH] fix env --- proxy/Cargo.toml | 3 +++ proxy/src/logging.rs | 16 ++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/proxy/Cargo.toml b/proxy/Cargo.toml index 3d851d0ae9..3b59b70d32 100644 --- a/proxy/Cargo.toml +++ b/proxy/Cargo.toml @@ -131,3 +131,6 @@ rstest.workspace = true walkdir.workspace = true rand_distr = "0.4" tokio-postgres.workspace = true + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)'] } diff --git a/proxy/src/logging.rs b/proxy/src/logging.rs index f1fffd1a3d..137a8f34eb 100644 --- a/proxy/src/logging.rs +++ b/proxy/src/logging.rs @@ -69,13 +69,17 @@ pub async fn init() -> anyhow::Result { None }; - let tokio_console = console_subscriber::ConsoleLayer::builder() - .enable_grpc_web(true) - .spawn(); + let reg = tracing_subscriber::registry(); - tracing_subscriber::registry() - .with(tokio_console) - .with(env_filter) + #[cfg(tokio_unstable)] + let reg = reg.with( + console_subscriber::ConsoleLayer::builder() + .with_default_env() + .enable_grpc_web(true) + .spawn(), + ); + + reg.with(env_filter) .with(otlp_layer) .with(json_log_layer) .with(text_log_layer)