Struct libstrophe::Logger
source · pub struct Logger<'cb> { /* private fields */ }
Expand description
Wrapper around the underlying 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) -> Selfwhere
CB: Fn(LogLevel, &str, &str) + Send + 'cb,
pub fn new<CB>(handler: CB) -> Selfwhere CB: Fn(LogLevel, &str, &str) + Send + 'cb,
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§
source§impl PartialEq<Logger<'_>> for Logger<'_>
impl PartialEq<Logger<'_>> for Logger<'_>
impl Eq for Logger<'_>
impl Send for Logger<'_>
Auto Trait Implementations§
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