Skip to content

Commit

Permalink
feat: RUST_LOG env high priority than min_level of config
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuliquan committed Dec 23, 2024
1 parent e8cb587 commit 1657359
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions crates/arroyo-server-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,13 @@ pub fn init_logging(name: &str) -> Option<WorkerGuard> {
}

fn parse_level_filter() -> LevelFilter {
let level_filter = config()
.logging
.min_level
.clone()
.unwrap_or(std::env::var(EnvFilter::DEFAULT_ENV).unwrap_or("info".to_string()));

let level_filter = std::env::var(EnvFilter::DEFAULT_ENV).unwrap_or(
config()
.logging
.min_level
.clone()
.unwrap_or("info".to_string()),
);
match level_filter.to_lowercase().as_str() {
"all" | "trace" => LevelFilter::TRACE,
"debug" => LevelFilter::DEBUG,
Expand Down

0 comments on commit 1657359

Please sign in to comment.