diff --git a/aquatic_udp_load_test/src/common.rs b/aquatic_udp_load_test/src/common.rs index b22547c..83a6a1b 100644 --- a/aquatic_udp_load_test/src/common.rs +++ b/aquatic_udp_load_test/src/common.rs @@ -1,6 +1,7 @@ use std::net::SocketAddr; use std::sync::{atomic::AtomicUsize, Arc}; +use aquatic_cli_helpers::LogLevel; use aquatic_common::cpu_pinning::CpuPinningConfig; use hashbrown::HashMap; use parking_lot::Mutex; @@ -16,6 +17,7 @@ pub struct ThreadId(pub u8); pub struct Config { /// Server address pub server_address: SocketAddr, + pub log_level: LogLevel, /// Number of sockets and socket worker threads /// /// Sockets will bind to one port each, and with @@ -102,6 +104,7 @@ impl Default for Config { fn default() -> Self { Self { server_address: "127.0.0.1:3000".parse().unwrap(), + log_level: LogLevel::Error, num_socket_workers: 1, num_request_workers: 1, duration: 0, diff --git a/aquatic_udp_load_test/src/main.rs b/aquatic_udp_load_test/src/main.rs index ca246ce..261cc5a 100644 --- a/aquatic_udp_load_test/src/main.rs +++ b/aquatic_udp_load_test/src/main.rs @@ -31,7 +31,11 @@ pub fn main() { ) } -impl aquatic_cli_helpers::Config for Config {} +impl aquatic_cli_helpers::Config for Config { + fn get_log_level(&self) -> Option { + Some(self.log_level) + } +} fn run(config: Config) -> ::anyhow::Result<()> { if config.handler.weight_announce + config.handler.weight_connect + config.handler.weight_scrape