Skip to content

Commit

Permalink
Added log level info as default when the env is not setted (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulobressan authored May 29, 2024
1 parent 7a702c6 commit 584b9cc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion proxy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use regex::Regex;
use serde::{Deserialize, Deserializer};
use tiers::TierBackgroundService;
use tokio::sync::RwLock;
use tracing::Level;
use tracing_subscriber::{fmt, layer::SubscriberExt, util::SubscriberInitExt, EnvFilter};

use crate::config::Config;
Expand All @@ -27,9 +28,14 @@ mod tiers;
fn main() {
dotenv().ok();

let env_filter = EnvFilter::builder()
.with_default_directive(Level::INFO.into())
.with_env_var("RUST_LOG")
.from_env_lossy();

tracing_subscriber::registry()
.with(fmt::layer())
.with(EnvFilter::from_default_env())
.with(env_filter)
.init();

let config: Arc<Config> = Arc::default();
Expand Down

0 comments on commit 584b9cc

Please sign in to comment.