Files
solana/src/logger.rs
Greg Fitzgerald 0ef099421c cargo fmt
2018-12-08 23:19:55 -07:00

17 lines
458 B
Rust

//! The `logger` module provides a setup function for `env_logger`. Its only function,
//! `setup()` may be called multiple times.
use env_logger;
use std::sync::{Once, ONCE_INIT};
static INIT: Once = ONCE_INIT;
/// Setup function that is only run once, even if called multiple times.
pub fn setup() {
INIT.call_once(|| {
env_logger::Builder::from_default_env()
.default_format_timestamp_nanos(true)
.init();
});
}