Skip to content

Commit

Permalink
src: lib: cli,logger: Fix command_line display
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoantoniocardoso committed Oct 22, 2024
1 parent f5ad75c commit e886aa8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 7 additions & 1 deletion src/lib/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use tracing::*;

use crate::drivers;

#[derive(Parser)]
#[derive(Debug, Parser)]
#[command(
version = env!("CARGO_PKG_VERSION"),
author = env!("CARGO_PKG_AUTHORS"),
Expand Down Expand Up @@ -166,6 +166,12 @@ pub fn command_line_string() -> String {
std::env::args().collect::<Vec<String>>().join(" ")
}

// Return a clone of current Args struct
#[instrument(level = "debug")]
pub fn command_line() -> String {
format!("{:#?}", MANAGER.clap_matches)
}

#[instrument(level = "debug")]
pub fn udp_server_timeout() -> Option<tokio::time::Duration> {
let seconds = MANAGER.clap_matches.udp_server_timeout;
Expand Down
5 changes: 1 addition & 4 deletions src/lib/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,5 @@ pub fn init() {
chrono::Local::now().format("%Y-%m-%dT%H:%M:%S"),
);
debug!("Command line call: {}", cli::command_line_string());
debug!(
"Command line input struct call: {}",
cli::command_line_string()
);
debug!("Command line input struct call: {}", cli::command_line());
}

0 comments on commit e886aa8

Please sign in to comment.