Skip to content

Commit

Permalink
Implement sdre rust logging changes to use the string instead of u8
Browse files Browse the repository at this point in the history
  • Loading branch information
fredclausen committed Dec 7, 2023
1 parent 2d8afca commit cdd13fb
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 18 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions rootfs/etc/s6-overlay/scripts/acars_router
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@

AR_COMMAND=()

if [[ ${AR_VERBOSITY,,} =~ debug || $AR_VERBOSITY -eq 1 ]]; then
AR_COMMAND+=("-v")
elif [[ ${AR_VERBOSITY,,} =~ trace || $AR_VERBOSITY -ge 2 ]]; then
AR_COMMAND+=("-vv")
fi

# ACARS Input

if [[ -n $AR_LISTEN_UDP_ACARS ]]; then
Expand Down
2 changes: 1 addition & 1 deletion rust/bin/acars_router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ serde = { version = "1.0.193", features = ["derive"] }
serde_json = "1.0.108"
failure = "0.1.8"
acars_config = { path = "../../libraries/acars_config" }
sdre-rust-logging = "0.1.0"
sdre-rust-logging = "0.2.0"
acars_connection_manager = { path = "../../libraries/acars_connection_manager" }
4 changes: 2 additions & 2 deletions rust/libraries/acars_config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ edition.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
clap = { version = "4.4.10", features = ["derive", "env"] }
clap = { version = "4.4.11", features = ["derive", "env"] }
log = "0.4.20"
sdre-rust-logging = "0.1.0"
sdre-rust-logging = "0.2.0"
6 changes: 3 additions & 3 deletions rust/libraries/acars_config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ use sdre_rust_logging::SetupLogging;
pub struct Input {
// Output Options
/// Set the log level. debug, trace, info are valid options.
#[clap(short, long, action = clap::ArgAction::Count)]
pub verbose: u8,
#[clap(short, long, env = "AR_VERBOSE", value_parser, default_value = "info")]
pub verbose: String,
/// Enable message deduplication
#[clap(long, env = "AR_ENABLE_DEDUPE", value_parser)]
pub enable_dedupe: bool,
Expand Down Expand Up @@ -128,7 +128,7 @@ impl Input {
debug!("AR_SEND_TCP_ACARS: {:?}", self.send_tcp_acars);
debug!("AR_SERVE_TCP_ACARS: {:?}", self.serve_tcp_acars);
debug!("AR_SERVE_ZMQ_ACARS: {:?}", self.serve_zmq_acars);
debug!("AR_VERBOSE: {:?}", self.verbose.set_logging_level());
debug!("AR_VERBOSE: {:?}", self.verbose.clone().set_logging_level());
debug!("AR_ADD_PROXY_ID: {:?}", self.add_proxy_id);
debug!("AR_ENABLE_DEDUPE: {:?}", self.enable_dedupe);
debug!("AR_DEDUPE_WINDOW: {:?}", self.dedupe_window);
Expand Down

0 comments on commit cdd13fb

Please sign in to comment.