Skip to content

Commit

Permalink
add separate logging for wgpu_hal
Browse files Browse the repository at this point in the history
  • Loading branch information
Ciubix8513 committed Jul 8, 2024
1 parent 2e5badc commit 97310b2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub fn initialize_logging() -> Result<(), lunar_logger::LoggerError> {
let mut log_level = log::LevelFilter::Info;
let mut engine_log_level = log::LevelFilter::Info;
let mut wgpu_log_level = log::LevelFilter::Warn;
let mut wgpu_hal_log_level = log::LevelFilter::Warn;

let mut log_to_file = false;

Expand All @@ -31,14 +32,15 @@ pub fn initialize_logging() -> Result<(), lunar_logger::LoggerError> {
"ENGINE_LOG_LEVEL" => engine_log_level = parse_log_level(&value),
"GENERATE_LOGS" => log_to_file = true,
"WGPU_LOG_LEVEL" => wgpu_log_level = parse_log_level(&value),
"WGPU_HAL_LOG_LEVEL" => wgpu_hal_log_level = parse_log_level(&value),
_ => {}
}
}
}

let mut b = lunar_logger::Builder::new()
.add_crate_filter("wgpu", wgpu_log_level)
.add_crate_filter("wgpu_hal", wgpu_log_level)
.add_crate_filter("wgpu_hal", wgpu_hal_log_level)
.add_crate_filter("lunar_engine", engine_log_level)
.default_filter(log_level);
if log_to_file {
Expand Down

0 comments on commit 97310b2

Please sign in to comment.