1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
use log::SetLoggerError; pub fn try_init() -> Result<(), SetLoggerError> { #[cfg(feature = "log")] { env_logger::try_init() } #[cfg(feature = "no-log")] { Ok(()) } } pub fn init() { #[cfg(feature = "log")] env_logger::init(); }