Made debug prints depend on --verbose

This commit is contained in:
jan 2025-01-06 14:41:58 +01:00
parent c846b26da9
commit 09e947cd0a
2 changed files with 7 additions and 5 deletions

View File

@ -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(

View File

@ -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;
}