set_logger

Function set_logger 

Source
pub fn set_logger(logger: Arc<dyn Logger>)
Expand description

Sets the global logger.

This function allows you to provide your own implementation of the Logger trait. It initializes the logging system and should be called before any logging occurs.

§Arguments

  • logger - An Arc containing your logger implementation.

§Panics

Panics if the logger has already been set.

§Note

If the logger has already been set, this function will print a message and do nothing.