From e2b323cbb8e86b9d22d55f0b6aa3b288aa8df46b Mon Sep 17 00:00:00 2001 From: Ziad Mostafa Date: Tue, 12 Nov 2024 20:05:51 +0100 Subject: [PATCH] [#396] Revert default logger lazy initialization Signed-off-by: Ziad Mostafa --- iceoryx2-bb/log/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iceoryx2-bb/log/src/lib.rs b/iceoryx2-bb/log/src/lib.rs index 8dde04043..1d6a28c18 100644 --- a/iceoryx2-bb/log/src/lib.rs +++ b/iceoryx2-bb/log/src/lib.rs @@ -160,7 +160,7 @@ static DEFAULT_LOGGER: logger::tracing::Logger = logger::tracing::Logger::new(); static DEFAULT_LOGGER: logger::log::Logger = logger::log::Logger::new(); #[cfg(not(any(feature = "logger_log", feature = "logger_tracing")))] -pub static DEFAULT_LOGGER: Lazy = Lazy::new(logger::console::Logger::new); +static DEFAULT_LOGGER: logger::console::Logger = logger::console::Logger::new(); const DEFAULT_LOG_LEVEL: LogLevel = LogLevel::Info; pub static ENV_LOG_LEVEL: Lazy = Lazy::new(|| { @@ -240,7 +240,7 @@ pub fn set_logger(value: &'static T) -> bool { /// Returns a reference to the [`Log`]ger. pub fn get_logger() -> &'static dyn Log { INIT_LOGGER.call_once(|| { - unsafe { LOGGER = Some(&*DEFAULT_LOGGER) }; + unsafe { LOGGER = Some(&DEFAULT_LOGGER) }; }); // # From The Compiler