Skip to content

Commit

Permalink
Added debug flag to CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
lte678 committed Oct 26, 2024
1 parent 735575f commit 8be2447
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ extern crate glium;
#[command(version, about, long_about = None)]
struct Args {
device: Option<String>,
#[arg(short, long)]
debug: bool,
}

#[derive(Copy, Clone)]
Expand All @@ -42,6 +44,15 @@ const MAX_ITERATIONS: u32 = 200;
fn main() {
env_logger::init();
let cli = Args::parse();

// Prepare logging
let mut log_builder = env_logger::builder();
if cli.debug {
log_builder.filter_level(log::LevelFilter::Debug);
}
log_builder.init();

// Pick device to run on
if let Some(device) = cli.device {
if device == "cpu" {
cpu_mode();
Expand Down

0 comments on commit 8be2447

Please sign in to comment.