Skip to content
Snippets Groups Projects
Commit 27652e00 authored by Federico Lolli's avatar Federico Lolli
Browse files

Added verbose flag (for debug traces)

parent 350e5200
No related branches found
No related tags found
No related merge requests found
export RUST_LOG := "debug"
alias hb := host-build alias hb := host-build
alias dbs := device-build-sender alias dbs := device-build-sender
alias dbr := device-build-receiver alias dbr := device-build-receiver
default: default:
./arpist gemini.csv ./arpist -v gemini.csv
host-build: host-build:
#!/bin/bash #!/bin/bash
......
...@@ -26,6 +26,10 @@ pub struct Cli { ...@@ -26,6 +26,10 @@ pub struct Cli {
/// sending the next one /// sending the next one
#[clap(short, long)] #[clap(short, long)]
pub sync: bool, pub sync: bool,
/// The log level
#[clap(short, long, default_value = "false")]
pub verbose: bool,
} }
pub fn get_styles() -> Styles { pub fn get_styles() -> Styles {
......
...@@ -25,14 +25,22 @@ use crate::{ ...@@ -25,14 +25,22 @@ use crate::{
const ACK: u8 = 0x06; const ACK: u8 = 0x06;
fn main() { 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() simple_logger::SimpleLogger::new()
.with_level(log::LevelFilter::Info) .with_level(lvl)
.with_local_timestamps() .with_local_timestamps()
.env() .env()
.init() .init()
.unwrap(); .unwrap();
let args: Cli = Cli::parse();
let mut packets = Vec::new(); let mut packets = Vec::new();
info!("reading from {}", args.csv_input.display()); info!("reading from {}", args.csv_input.display());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment