diff --git a/backend/src/log.rs b/backend/src/log.rs index 2c86ab0..720b2b2 100644 --- a/backend/src/log.rs +++ b/backend/src/log.rs @@ -35,7 +35,6 @@ pub enum Log { directory: PathBuf, }, StdoutOnly, - NoLog, } impl Log { @@ -86,8 +85,12 @@ impl Log { } pub fn new_to_stdout_only() -> Self { + Self::new_to_stdout_only_with_max_level(None) + } + + pub fn new_to_stdout_only_with_max_level(level: Option) -> Self { let layer_stdout = tracing_subscriber::fmt::layer() - .with_writer(std::io::stdout.with_max_level(TRACING_LEVEL)) + .with_writer(std::io::stdout.with_max_level(level.unwrap_or(TRACING_LEVEL))) .with_thread_ids(TRACING_DISPLAY_THREAD) .with_thread_names(TRACING_DISPLAY_THREAD); @@ -98,10 +101,6 @@ impl Log { Log::StdoutOnly } - pub fn new_no_log() -> Self { - Log::NoLog - } - pub fn file_names(&self) -> std::io::Result> { match self { Log::FileAndStdout { _guard, directory } => { @@ -130,7 +129,7 @@ impl Log { .rev() .collect()) } - Log::StdoutOnly | Log::NoLog => Ok(vec![]), + Log::StdoutOnly => Ok(vec![]), } } @@ -145,7 +144,7 @@ impl Log { .map(|l| l.unwrap_or_default()) .collect()) } - Log::StdoutOnly | Log::NoLog => Ok(vec![]), + Log::StdoutOnly => Ok(vec![]), } }