pub struct Logger<'cb> { /* private fields */ }
Expand description
Wrapper around the underlying sys::xmpp_log_t struct.
The best option to get a logger is to call Logger::default(). It will return you a logger that
is tied into Rust logging facility provided by log crate. This functionality is available when
compiling with the default rust-log
feature.
This struct implements:
Eq
by comparing internal pointersHash
by hashing internal pointerSend
Implementations§
Source§impl<'cb> Logger<'cb>
impl<'cb> Logger<'cb>
Sourcepub fn new<CB>(handler: CB) -> Self
pub fn new<CB>(handler: CB) -> Self
Create a new custom logger.
The callback argument will be called every time a log message needs to be printed.
Sourcepub fn new_internal(log_level: LogLevel) -> Logger<'static>
pub fn new_internal(log_level: LogLevel) -> Logger<'static>
This method returns default libstrophe
logger that just outputs log lines to stderr. Use it
if you compile without rust-log
feature and want a quick debug log output.
Sourcepub fn new_null() -> Logger<'static>
pub fn new_null() -> Logger<'static>
This method returns null logger that doesn’t output any information.
pub fn log(&self, level: LogLevel, area: &str, msg: &str)
Trait Implementations§
impl Eq for Logger<'_>
impl Send for Logger<'_>
Auto Trait Implementations§
impl<'cb> Freeze for Logger<'cb>
impl<'cb> !RefUnwindSafe for Logger<'cb>
impl<'cb> !Sync for Logger<'cb>
impl<'cb> Unpin for Logger<'cb>
impl<'cb> !UnwindSafe for Logger<'cb>
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