#[non_exhaustive]pub struct RustLogAdapter;Expand description
This is an implementation of LoggerImpl that can be used to pipe CRT log messages into the
Rust log facade. To install it, call RustLogAdapter::try_init(), and then CRT log messages
will be sent to the log facade. These messages will follow that facade’s logic for when to
emit log messages. All CRT log messages will have a target that starts with the value of
AWSCRT_LOG_TARGET.
Implementations§
Source§impl RustLogAdapter
impl RustLogAdapter
Sourcepub fn try_init() -> Result<(), LoggerInitError>
pub fn try_init() -> Result<(), LoggerInitError>
Try to install the log adapter as the current CRT logger. Only one CRT logger can be
installed for the lifetime of the program, so this returns Err if a logger has already been
installed.
Trait Implementations§
Source§impl Debug for RustLogAdapter
impl Debug for RustLogAdapter
Source§impl LoggerImpl for RustLogAdapter
impl LoggerImpl for RustLogAdapter
Source§fn log(&self, log_level: Level, subject: Subject, message: &str)
fn log(&self, log_level: Level, subject: Subject, message: &str)
Log a new message at the given level for a subject
Source§fn get_log_level(&self, _subject: Subject) -> Level
fn get_log_level(&self, _subject: Subject) -> Level
Get the maximum log level that this logger is currently interested in. This method allows
the CRT to avoid the cost of formatting log messages that won’t be emitted.
Auto Trait Implementations§
impl Freeze for RustLogAdapter
impl RefUnwindSafe for RustLogAdapter
impl Send for RustLogAdapter
impl Sync for RustLogAdapter
impl Unpin for RustLogAdapter
impl UnsafeUnpin for RustLogAdapter
impl UnwindSafe for RustLogAdapter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more