mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 03:21:08 +03:00
Logger init for tests
This commit is contained in:
parent
6c18451a2b
commit
f12559f53b
2 changed files with 13 additions and 1 deletions
|
@ -35,7 +35,7 @@ extern crate serde_derive;
|
||||||
|
|
||||||
// Logging related
|
// Logging related
|
||||||
pub mod logger;
|
pub mod logger;
|
||||||
pub use logger::{LOGGER, init_logger};
|
pub use logger::{LOGGER, init_logger, init_test_logger};
|
||||||
|
|
||||||
pub mod types;
|
pub mod types;
|
||||||
pub use types::LoggingConfig;
|
pub use types::LoggingConfig;
|
||||||
|
|
|
@ -89,3 +89,15 @@ pub fn init_logger(config: Option<LoggingConfig>) {
|
||||||
*was_init_ref = true;
|
*was_init_ref = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Initializes the logger for unit and integration tests
|
||||||
|
pub fn init_test_logger() {
|
||||||
|
let mut was_init_ref = WAS_INIT.lock().unwrap();
|
||||||
|
if was_init_ref {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let mut config_ref = LOGGING_CONFIG.lock().unwrap();
|
||||||
|
*config_ref = LoggingConfig::default();
|
||||||
|
*was_init_ref = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue