macro_rules! init_timed_local {
    () => { ... };
}
Expand description

Initializes the global logger with a “no-frills” local date/time pretty, sensible env logger.

This should be called early in the execution of a Rust program, and the global logger may only be initialized once. Future initialization attempts will return an error.

Details

This variant formats log messages with a localized timestamp, prefixed by the date part.

Example

2021-10-27 12:15:31.683 - INFO  my_module         > an info message!

Requirements

Using this macro requires the local-time feature to be enabled:

[dependencies]
sensible-env-logger = { version = "*", features = ["local-time"] }

Panics

This macro fails to set the global logger if one has already been set.