diff --git a/nomos-cluster-tests/src/config.rs b/nomos-cluster-tests/src/config.rs index ed7d5b76..4f527eb6 100644 --- a/nomos-cluster-tests/src/config.rs +++ b/nomos-cluster-tests/src/config.rs @@ -1,14 +1,14 @@ +use clap::{Parser, ValueEnum}; +use color_eyre::eyre::{eyre, Result}; +use serde::{Deserialize, Serialize}; use std::net::ToSocketAddrs; use std::path::PathBuf; -use clap::{Parser, ValueEnum}; -use serde::{Deserialize, Serialize}; -use color_eyre::eyre::{eyre, Result}; use tracing::Level; -use nomos_tracing_service::{LoggerLayer, Tracing}; -use overwatch_rs::services::ServiceData; use nomos_tracing::logging::gelf::GelfConfig; use nomos_tracing::logging::local::FileConfig; +use nomos_tracing_service::{LoggerLayer, Tracing}; +use overwatch_rs::services::ServiceData; #[derive(ValueEnum, Clone, Debug, Default)] pub enum LoggerLayerType { @@ -19,7 +19,6 @@ pub enum LoggerLayerType { Stderr, } - #[derive(Parser, Debug, Clone)] pub struct LogArgs { /// Address for the Gelf backend @@ -48,10 +47,7 @@ pub struct Config { } impl Config { - pub fn update_from_args( - mut self, - log_args: LogArgs, - ) -> Result { + pub fn update_from_args(mut self, log_args: LogArgs) -> Result { update_tracing(&mut self.tracing, log_args)?; Ok(self) } @@ -98,4 +94,4 @@ pub fn update_tracing( }; } Ok(()) -} \ No newline at end of file +} diff --git a/nomos-cluster-tests/src/main.rs b/nomos-cluster-tests/src/main.rs index 4d7f8a9b..57aa308e 100644 --- a/nomos-cluster-tests/src/main.rs +++ b/nomos-cluster-tests/src/main.rs @@ -1,8 +1,8 @@ mod config; -use clap::Parser; use crate::config::{Config, LogArgs}; -use color_eyre::eyre::{Result}; +use clap::Parser; +use color_eyre::eyre::Result; #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] @@ -14,21 +14,13 @@ struct Args { log_args: LogArgs, } - fn main() -> Result<()> { - // Parse cluster options - let Args { - config, - log_args, - } = Args::parse(); - let config = serde_yaml::from_reader::<_, Config>(std::fs::File::open(config)?)? - .update_from_args( - log_args, - )?; + let Args { config, log_args } = Args::parse(); + let _config = serde_yaml::from_reader::<_, Config>(std::fs::File::open(config)?)? + .update_from_args(log_args)?; // Run the test suite - Ok(()) }