[][src]Function log::set_logger

pub fn set_logger<M>(make_logger: M) -> Result<(), SetLoggerError> where
    M: FnOnce(MaxLogLevelFilter) -> Box<dyn Log>, 

Sets the global logger.

The make_logger closure is passed a MaxLogLevel object, which the logger should use to keep the global maximum log level in sync with the highest log level that the logger will not ignore.

This function may only be called once in the lifetime of a program. Any log events that occur before the call to set_logger completes will be ignored.

This function does not typically need to be called manually. Logger implementations should provide an initialization method that calls set_logger internally.

Requires the use_std feature (enabled by default).