From bed78e0d7b35fc23f2bc5d7f6bef35b4bf15b19f Mon Sep 17 00:00:00 2001 From: jutty Date: Wed, 7 Jan 2026 01:03:28 -0300 Subject: [PATCH] Do not print logging output if DEBUG < 1 --- src/dev.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/dev.rs b/src/dev.rs index 3af9440..a9f8fbf 100644 --- a/src/dev.rs +++ b/src/dev.rs @@ -38,11 +38,11 @@ macro_rules! log { path_vec.get(path_vec.len().saturating_sub(2)), path_vec.get(path_vec.len().saturating_sub(3)), ) { - display_path = if level > 3 { + display_path = if level > 4 { format!("{} -> {}", trace, path.clone()) - } else if level > 2 { + } else if level > 3 { path.clone() - } else if level > 0 { + } else if level > 1 { format!("{third_to_last}::{second_to_last}::{last}") } else { format!("{second_to_last}::{last}") @@ -55,7 +55,9 @@ macro_rules! log { let filter = std::env::var("DEBUG_FILTER").unwrap_or("any".to_string()); if $crate::dev::SKIP_PATHS.iter().all(|&s| !trace.contains(s)) && - (filter == "any" || filter.is_empty() || path.contains(&filter)) { + (filter == "any" || filter.is_empty() || path.contains(&filter)) && + level > 0 + { $crate::dev::elog(&display_path, &format!($fmt $(, $($arg)+ )?)); };