1 2 3 4 5 6 7 8 9
use bnr::Result; use std::sync::{Mutex, MutexGuard}; static INIT: Mutex<()> = Mutex::new(()); pub fn init() -> Result<MutexGuard<'static, ()>> { env_logger::try_init().ok(); Ok(INIT.lock()?) }