Skip to content

Commit

Permalink
[eclipse-iceoryx#396] Update logging to use latest trait
Browse files Browse the repository at this point in the history
Signed-off-by: Ziad Mostafa <[email protected]>
  • Loading branch information
zmostafa committed Nov 7, 2024
1 parent ec18a75 commit 890e941
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions iceoryx2-bb/log/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ use std::{
sync::{atomic::Ordering, Once},
};

use logger::Logger;
use once_cell::sync::Lazy;
use std::env;

Expand All @@ -170,7 +169,7 @@ pub static ENV_LOG_LEVEL: Lazy<LogLevel> = Lazy::new(|| {
.unwrap_or(LogLevel::Info)
});

static mut LOGGER: Option<&'static dyn logger::Logger> = None;
static mut LOGGER: Option<&'static dyn Log> = None;
static LOG_LEVEL: IoxAtomicU8 = IoxAtomicU8::new(DEFAULT_LOG_LEVEL as u8);
static INIT_LOGGER: Once = Once::new();
static INIT_LOG_LEVEL: Once = Once::new();
Expand Down Expand Up @@ -240,8 +239,8 @@ 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.call_once(|| {
unsafe { LOGGER = Some(&DEFAULT_LOGGER) };
INIT_LOGGER.call_once(|| {
unsafe { LOGGER = Some(&*DEFAULT_LOGGER) };
});

// # From The Compiler
Expand Down

0 comments on commit 890e941

Please sign in to comment.