Skip to content

Commit

Permalink
feat: make 'INFO' the default log level
Browse files Browse the repository at this point in the history
  • Loading branch information
woshilapin committed Oct 19, 2023
1 parent a404dfc commit b18610c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ use std::sync::{mpsc, RwLock};
use std::thread;
use std::time::Duration;
#[cfg(not(feature = "shuttle"))]
use tracing_subscriber::{layer::SubscriberExt as _, util::SubscriberInitExt as _, EnvFilter};
use tracing_subscriber::{
filter::LevelFilter, layer::SubscriberExt as _, util::SubscriberInitExt as _, EnvFilter,
};
#[cfg(feature = "shuttle")]
use {
actix_web::web::{self, ServiceConfig},
Expand All @@ -39,7 +41,11 @@ fn setup(config_folder: &Path) -> IoResult<(Data<RwLock<Config>>, ServerConfig,
// Initialize logger.
#[cfg(not(feature = "shuttle"))]
tracing_subscriber::registry()
.with(EnvFilter::from_default_env())
.with(
EnvFilter::builder()
.with_default_directive(LevelFilter::INFO.into())
.from_env_lossy(),
)
.with(tracing_subscriber::fmt::layer())
.init();

Expand Down

0 comments on commit b18610c

Please sign in to comment.