Skip to content

Commit

Permalink
Prevent log spam
Browse files Browse the repository at this point in the history
  • Loading branch information
Sirius902 committed Jan 18, 2023
1 parent aa672f8 commit 5ee8bfe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/gcfeeder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
5 changes: 5 additions & 0 deletions crates/gcfeeder/src/gui/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 5ee8bfe

Please sign in to comment.