From b46df240fdfd6aea027f6c1a0ddc077506bee11c Mon Sep 17 00:00:00 2001 From: Lucien Greathouse Date: Fri, 1 Dec 2023 01:35:49 -0500 Subject: [PATCH] Add YAKUI_LOG_DEBUG in bootstrap for better debug logging --- crates/bootstrap/src/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/bootstrap/src/lib.rs b/crates/bootstrap/src/lib.rs index 8a4a2457..a8923b2a 100644 --- a/crates/bootstrap/src/lib.rs +++ b/crates/bootstrap/src/lib.rs @@ -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(); }