Skip to content

Commit

Permalink
chore: change default log level
Browse files Browse the repository at this point in the history
  • Loading branch information
Akagi201 committed Oct 15, 2024
1 parent 84839d7 commit 323509d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/cmd/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use helix_api::service::ApiService;
use helix_common::{LoggingConfig, RelayConfig};
use tokio::runtime::Builder;
use tracing::level_filters::LevelFilter;

async fn run() {
let config = match RelayConfig::load() {
Expand All @@ -15,14 +16,15 @@ async fn run() {

match &config.logging {
LoggingConfig::Console => {
let filter_layer = tracing_subscriber::EnvFilter::from_default_env();
let filter_layer = tracing_subscriber::EnvFilter::from_default_env().add_directive(LevelFilter::INFO.into());

tracing_subscriber::fmt().with_env_filter(filter_layer).init();
}
LoggingConfig::File { dir_path, file_name } => {
let file_appender = tracing_appender::rolling::daily(dir_path, file_name);
let (non_blocking, guard) = tracing_appender::non_blocking(file_appender);

let filter_layer = tracing_subscriber::EnvFilter::from_default_env();
let filter_layer = tracing_subscriber::EnvFilter::from_default_env().add_directive(LevelFilter::INFO.into());

tracing_subscriber::fmt().with_env_filter(filter_layer).with_writer(non_blocking).init();
_guard = Some(guard);
Expand Down

0 comments on commit 323509d

Please sign in to comment.