[][src]Struct libstrophe::Logger

pub struct Logger<'cb> { /* fields omitted */ }

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 pointers
  • Hash by hashing internal pointer
  • Send

Methods

impl<'cb> Logger<'cb>[src]

pub fn new<CB>(handler: CB) -> Self where
    CB: FnMut(LogLevel, &str, &str) + Send + 'cb, 
[src]

Create a new custom logger.

The callback argument will be called every time a log message needs to be printed.

pub fn new_internal(log_level: LogLevel) -> Logger<'static>[src]

xmpp_get_default_logger

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.

pub fn new_null() -> Logger<'static>[src]

This method returns null logger that doesn't output any information.

pub fn as_inner(&self) -> *const xmpp_log_t[src]

Trait Implementations

impl<'_> Send for Logger<'_>[src]

impl<'_> Drop for Logger<'_>[src]

impl Default for Logger<'static>[src]

fn default() -> Self[src]

Return a new logger that logs to standard Rust logging facilities.

Logging facilities are provided by log crate. Only available when compiling with rust-log feature.

impl<'_> Eq for Logger<'_>[src]

impl<'_> PartialEq<Logger<'_>> for Logger<'_>[src]

impl<'_> Debug for Logger<'_>[src]

impl<'_> Hash for Logger<'_>[src]

Auto Trait Implementations

impl<'cb> !Sync for Logger<'cb>

impl<'cb> Unpin for Logger<'cb>

impl<'cb> !UnwindSafe for Logger<'cb>

impl<'cb> !RefUnwindSafe for Logger<'cb>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]