borntyping / rust-simple_logger

A rust logger that prints all messages with a readable output format.
https://crates.io/crates/simple_logger
MIT License
221 stars 48 forks source link

SimpleLogger::from_env(); example is incomplete #23

Closed snakehand closed 4 years ago

snakehand commented 4 years ago

I just did the upgrade from

simple_logger::init_by_env();

and tried to use: SimpleLogger::from_env();

But this caused regression, since the time stamps disappeared.

What I had to do to maintain the same functionality was: SimpleLogger::from_env().init().unwrap();

I am not sure what the correct fix is: a) Have from_env() do the init b) Update the excample, and possibly have from_env() warn of unused result