From da7d012393b4d3d690a681e41c61627aa6fd1447 Mon Sep 17 00:00:00 2001 From: Quentin Boyer Date: Sat, 20 May 2023 11:40:20 +0200 Subject: [PATCH] Allow to control tracing from the environment --- src/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.rs b/src/main.rs index 382c490..12c9894 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,6 +8,7 @@ use migration::{Migrator, MigratorTrait}; use sea_orm::{ConnectOptions, Database, DatabaseConnection}; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use tower_http::services::ServeDir; +use tracing_subscriber::EnvFilter; pub(crate) mod entity; mod routes; @@ -101,6 +102,7 @@ async fn main() -> anyhow::Result<()> { tracing_subscriber::fmt() .with_max_level(tracing::Level::DEBUG) .with_test_writer() + .with_env_filter(EnvFilter::from_default_env()) .init(); let config = Settings::new()?;