Function spdlog::init_log_crate_proxy
source · pub fn init_log_crate_proxy() -> Result<(), SetLoggerError>
Available on crate feature
log
only.Expand description
Initialize log crate proxy.
This function calls log::set_logger
to set up a LogCrateProxy
and
all logs from log crate will be forwarded to spdlog-rs
’s logger.
Users should call this function only once. Get the proxy to configure by
calling log_crate_proxy()
.
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
.
For more details, please read documentation of log::set_logger
and
LogCrateProxy
.