Closed softdevca closed 1 year ago
The new method of loggers are now #[must_use] to prevent confusion when new is used called instead of init.
new
#[must_use]
init
Currently the following code will appear completely valid but silently not do any logging:
use log::*; use simplelog::*; fn main() { TermLogger::new( LevelFilter::Trace, Config::default(), TerminalMode::Stdout, ColorChoice::Auto, ); error!("Red error"); warn!("Yellow warning"); info!("Blue info"); debug!("Cyan debug"); trace!("White trace"); }
With this change a compiler warning is generated on new.
Coverage remained the same at 53.947% when pulling 80242aab3cd860e40208af4b2069d1b49a1be14a on softdevca:pr-must_use-new into 626467d20046edb9c020acfbae461c2dd9cb2e17 on Drakulix:master.
Thanks!
The
new
method of loggers are now#[must_use]
to prevent confusion whennew
is used called instead ofinit
.Currently the following code will appear completely valid but silently not do any logging:
With this change a compiler warning is generated on
new
.