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 5664951
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 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 @@ -13,17 +14,16 @@ async fn run() {

let _guard;

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

match &config.logging {
LoggingConfig::Console => {
let filter_layer = tracing_subscriber::EnvFilter::from_default_env();
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();

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

0 comments on commit 5664951

Please sign in to comment.