From 09e947cd0aa8e2745247b750ce1f5d09275cb575 Mon Sep 17 00:00:00 2001 From: jan Date: Mon, 6 Jan 2025 14:41:58 +0100 Subject: [PATCH] Made debug prints depend on --verbose --- src/cli.rs | 2 +- src/main.rs | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 71a9e7e..e690698 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -27,7 +27,7 @@ pub struct Cli { short, long, default_value_t = false, - help = "Show performance metrics" + help = "Show performance metrics and debug info" )] pub verbose: bool, #[arg( diff --git a/src/main.rs b/src/main.rs index 988a552..cb23554 100644 --- a/src/main.rs +++ b/src/main.rs @@ -78,10 +78,12 @@ async fn main() -> Result<()> { ipf = 0; while !engine.wants_to_sync() && ipf <= MAX_IPF { if let Some(debug_output) = engine.step()? { - println!( - "DEBUG label: {} values: {}, {}", - debug_output.0, debug_output.1, debug_output.2 - ); + if cli.verbose { + println!( + "DEBUG label: {} values: {}, {}", + debug_output.0, debug_output.1, debug_output.2 + ); + } } ipf += 1; }