From 5ee8bfe2f4bb6b72aa200d943222337188a2508b Mon Sep 17 00:00:00 2001 From: Sirius902 <3645979-Sirius902@users.noreply.gitlab.com> Date: Tue, 17 Jan 2023 22:24:12 -0800 Subject: [PATCH] Prevent log spam --- crates/gcfeeder/Cargo.toml | 4 ++++ crates/gcfeeder/src/gui/log.rs | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/crates/gcfeeder/Cargo.toml b/crates/gcfeeder/Cargo.toml index 9fdafe0..cf8ba9d 100644 --- a/crates/gcfeeder/Cargo.toml +++ b/crates/gcfeeder/Cargo.toml @@ -63,3 +63,7 @@ embed-resource = "1.8.0" version = "0.24.5" default-features = false features = ["png", "ico"] + +[features] +default = ["no-log-spam"] +no-log-spam = [] diff --git a/crates/gcfeeder/src/gui/log.rs b/crates/gcfeeder/src/gui/log.rs index 75c0d0a..0810e8f 100644 --- a/crates/gcfeeder/src/gui/log.rs +++ b/crates/gcfeeder/src/gui/log.rs @@ -39,6 +39,11 @@ impl log::Log for Logger { record.module_path().unwrap_or_default() }; + #[cfg(feature = "no-log-spam")] + if target.starts_with("wgpu") || target.starts_with("naga") { + return; + } + let _ = self.sender.send(Message { timestamp, level: record.level(),