Skip to content

Commit

Permalink
fix logging env level (#548)
Browse files Browse the repository at this point in the history
  • Loading branch information
kralverde authored Feb 13, 2025
1 parent 73d3fe0 commit 95e04c7
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions pumpkin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ pub static LOGGER_IMPL: LazyLock<Option<(Box<dyn Log>, LevelFilter)>> = LazyLock
logger = logger.without_timestamps();
}

Some((
Box::new(
logger
.with_level(LevelFilter::Info)
.with_colors(ADVANCED_CONFIG.logging.color)
.with_threads(ADVANCED_CONFIG.logging.threads)
.env(),
),
LevelFilter::Info,
))
let logger = logger
.with_level(LevelFilter::Info)
.with_colors(ADVANCED_CONFIG.logging.color)
.with_threads(ADVANCED_CONFIG.logging.threads)
.env();

// Incase environment variables change it
let max_level = logger.max_level();

Some((Box::new(logger), max_level))
} else {
None
}
Expand All @@ -66,8 +66,8 @@ pub static LOGGER_IMPL: LazyLock<Option<(Box<dyn Log>, LevelFilter)>> = LazyLock
macro_rules! init_log {
() => {
if let Some((logger_impl, level)) = &*pumpkin::LOGGER_IMPL {
log::set_max_level(*level);
log::set_logger(logger_impl).unwrap();
log::set_max_level(*level);
}
};
}
Expand Down

0 comments on commit 95e04c7

Please sign in to comment.