diff --git a/justfile b/justfile index a19e273ded52c416c64fc3be05310dbb40b1dfd4..e49488c58ee5f052a26c673ad216708ca8538b9f 100644 --- a/justfile +++ b/justfile @@ -1,11 +1,9 @@ -export RUST_LOG := "debug" - alias hb := host-build alias dbs := device-build-sender alias dbr := device-build-receiver default: - ./arpist gemini.csv + ./arpist -v gemini.csv host-build: #!/bin/bash diff --git a/on-host/src/cli.rs b/on-host/src/cli.rs index 267efbfb52c998e9c2d5cce81c07001bb243853f..9da2e5b8f629605bba84bb6507362618f6cea8f7 100644 --- a/on-host/src/cli.rs +++ b/on-host/src/cli.rs @@ -26,6 +26,10 @@ pub struct Cli { /// sending the next one #[clap(short, long)] pub sync: bool, + + /// The log level + #[clap(short, long, default_value = "false")] + pub verbose: bool, } pub fn get_styles() -> Styles { diff --git a/on-host/src/main.rs b/on-host/src/main.rs index 7eb4875950cd26e92e56fed0f1f0fc7c6a707916..49ba42da36eb7def72a9e97491c44a7ad7b9903c 100644 --- a/on-host/src/main.rs +++ b/on-host/src/main.rs @@ -25,14 +25,22 @@ use crate::{ const ACK: u8 = 0x06; fn main() { + let args: Cli = Cli::parse(); + + let lvl = if args.verbose { + log::LevelFilter::Debug + } else { + log::LevelFilter::Info + }; + + // initialize logger simple_logger::SimpleLogger::new() - .with_level(log::LevelFilter::Info) + .with_level(lvl) .with_local_timestamps() .env() .init() .unwrap(); - let args: Cli = Cli::parse(); let mut packets = Vec::new(); info!("reading from {}", args.csv_input.display());