Enable logs in unit tests

This commit is contained in:
Kirill Bulatov
2023-01-12 15:14:04 +02:00
committed by Anastasia Lubennikova
parent cb356f3259
commit ffca97bc1e
2 changed files with 8 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ use strum_macros::{EnumString, EnumVariantNames};
pub enum LogFormat {
Plain,
Json,
Test,
}
impl LogFormat {
@@ -39,6 +40,7 @@ pub fn init(log_format: LogFormat) -> anyhow::Result<()> {
match log_format {
LogFormat::Json => base_logger.json().init(),
LogFormat::Plain => base_logger.init(),
LogFormat::Test => base_logger.with_test_writer().init(),
}
Ok(())