Struct spdlog::LogCrateProxy
source · [−]pub struct LogCrateProxy { /* private fields */ }
Expand description
Log crate proxy.
It forwards all logs from log crate to default_logger
by default, and
you can set a separate logger for it via LogCrateProxy::set_logger
.
Note that the log
crate uses a different log level filter and by default
it rejects all log messages. To log messages via the log
crate, you have
to call log::set_max_level
manually before logging. For more
information, please read the documentation of log::set_max_level
.
Examples
See ./examples directory.
Implementations
sourceimpl LogCrateProxy
impl LogCrateProxy
sourcepub fn swap_logger(&self, logger: Option<Arc<Logger>>) -> Option<Arc<Logger>>
This is supported on crate feature log
only.
pub fn swap_logger(&self, logger: Option<Arc<Logger>>) -> Option<Arc<Logger>>
This is supported on crate feature
log
only.Swaps a logger.
If the argument logger
is None
, the return value of
default_logger
will be used.
sourcepub fn set_logger(&self, logger: Option<Arc<Logger>>)
This is supported on crate feature log
only.
pub fn set_logger(&self, logger: Option<Arc<Logger>>)
This is supported on crate feature
log
only.Sets a logger.
If the argument logger
is None
, the return value of
default_logger
will be used.
Trait Implementations
sourceimpl Default for LogCrateProxy
impl Default for LogCrateProxy
sourcefn default() -> LogCrateProxy
fn default() -> LogCrateProxy
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl !RefUnwindSafe for LogCrateProxy
impl Send for LogCrateProxy
impl Sync for LogCrateProxy
impl Unpin for LogCrateProxy
impl !UnwindSafe for LogCrateProxy
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more