diff --git a/backend/src/log.rs b/backend/src/log.rs index a35056a..66a692c 100644 --- a/backend/src/log.rs +++ b/backend/src/log.rs @@ -35,6 +35,7 @@ pub enum Log { directory: PathBuf, }, StdoutOnly, + NoLog, } impl Log { @@ -90,6 +91,10 @@ 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 } => { @@ -118,7 +123,7 @@ impl Log { .rev() .collect()) } - Log::StdoutOnly => Ok(vec![]), + Log::StdoutOnly | Log::NoLog => Ok(vec![]), } } @@ -133,7 +138,7 @@ impl Log { .map(|l| l.unwrap_or_default()) .collect()) } - Log::StdoutOnly => Ok(vec![]), + Log::StdoutOnly | Log::NoLog => Ok(vec![]), } } diff --git a/backend/tests/utils.rs b/backend/tests/utils.rs index ac5e905..9ff5651 100644 --- a/backend/tests/utils.rs +++ b/backend/tests/utils.rs @@ -5,7 +5,7 @@ use recipes::{app, config, data::db, log}; pub async fn common_state() -> Result> { let db_connection = db::Connection::new_in_memory().await?; let config = config::Config::default(); - let log = log::Log::new_stdout_only(); + let log = log::Log::new_no_log(); Ok(app::AppState { config, db_connection,