Skip to content

Commit

Permalink
[eclipse-iceoryx#396] Revert default logger lazy initialization
Browse files Browse the repository at this point in the history
Signed-off-by: Ziad Mostafa <[email protected]>
  • Loading branch information
zmostafa committed Nov 12, 2024
1 parent 8b82aa2 commit e2b323c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions iceoryx2-bb/log/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<logger::console::Logger> = 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<LogLevel> = Lazy::new(|| {
Expand Down Expand Up @@ -240,7 +240,7 @@ pub fn set_logger<T: Log + 'static>(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
Expand Down

0 comments on commit e2b323c

Please sign in to comment.