Skip to content

Commit

Permalink
Add YAKUI_LOG_DEBUG in bootstrap for better debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
LPGhatguy committed Dec 1, 2023
1 parent eb8c55e commit b46df24
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion crates/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,18 @@ fn load_texture(bytes: &[u8], filter: TextureFilter) -> Texture {
/// Initialize our logging, adjusting the default log levels of some of our
/// noisier dependencies.
fn init_logging() {
let debug = std::env::var_os("YAKUI_LOG_DEBUG").is_some();
let level = if debug {
log::LevelFilter::Debug
} else {
log::LevelFilter::Info
};

env_logger::builder()
.filter_module("wgpu_hal::auxil::dxgi", log::LevelFilter::Off)
.filter_module("wgpu_core", log::LevelFilter::Warn)
.filter_module("wgpu_hal", log::LevelFilter::Warn)
.filter_level(log::LevelFilter::Info)
.filter_level(level)
.init();
}

Expand Down

0 comments on commit b46df24

Please sign in to comment.