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, short,
long, long,
default_value_t = false, default_value_t = false,
help = "Show performance metrics" help = "Show performance metrics and debug info"
)] )]
pub verbose: bool, pub verbose: bool,
#[arg( #[arg(

View File

@ -78,10 +78,12 @@ async fn main() -> Result<()> {
ipf = 0; ipf = 0;
while !engine.wants_to_sync() && ipf <= MAX_IPF { while !engine.wants_to_sync() && ipf <= MAX_IPF {
if let Some(debug_output) = engine.step()? { if let Some(debug_output) = engine.step()? {
println!( if cli.verbose {
"DEBUG label: {} values: {}, {}", println!(
debug_output.0, debug_output.1, debug_output.2 "DEBUG label: {} values: {}, {}",
); debug_output.0, debug_output.1, debug_output.2
);
}
} }
ipf += 1; ipf += 1;
} }