pub fn init(&self, header: String, log_dest: Box<dyn Write + Send>) -> Result<()> {
        self.try_lock(INITIALIZING)?;
        {
            let mut g = buf_guard(&self.log_buf);

            *g = Some(log_dest);
        }

        self.try_init_max_level();

        STATE.store(INITIALIZED, Ordering::SeqCst);
        self.write_log(header, Level::Info);

        Ok(())
    }
/// Initialize log system (once and only once).
/// Every call made after the first will have no effect besides returning `Ok` or `Err`.
///
/// # Arguments
///
/// * `header` - Info about the app that uses the logger.
/// * `log_dest` - Buffer for plain text logs. Needs to implements `Write` and `Send`.
///
/// # Example
///
/// ```
/// use logger::LOGGER;
///
/// use std::io::Cursor;
///
/// let mut logs = Cursor::new(vec![0; 15]);
///
/// LOGGER.init(
///     "Running Firecracker v.x".to_string(),
///     Box::new(logs),
/// );
/// ```
Initialize log system (once and only once).
Every call made after the first will have no effect besides returning `Ok` or `Err`.
Initialize log system ( once and only once ) . Every call made after the first will have no effect besides returning ` Ok ` or ` Err ` .
pub fn init(&self, header: String, log_dest: Box<dyn Write + Send>) -> Result<()> {
        self.try_lock(INITIALIZING)?;
        {
            let mut g = buf_guard(&self.log_buf);
            *g = Some(log_dest);
        }
        self.try_init_max_level();
        STATE.store(INITIALIZED, Ordering::SeqCst);
        self.write_log(header, Level::Info);
        Ok(())
    }
pub fn init ( & self , header : String , log_dest : Box < dyn Write + Send > ) -> Result < ( ) > { self . try_lock ( INITIALIZING ) ? ; { let mut g = buf_guard ( & self . log_buf ) ; * g = Some ( log_dest ) ; } self . try_init_max_level ( ) ; STATE . store ( INITIALIZED , Ordering :: SeqCst ) ; self . write_log ( header , Level :: Info ) ; Ok ( ( ) ) }
Initialize log system (once and only once).
Initialize log system ( once and only once ) .
&self
header
String
log_dest
Box<dyn Write + Send>
example
```
use logger::LOGGER.

use std::io::Cursor.



LOGGER.init(
"Running Firecracker v.x".to_string(),
Box::new(logs),
);
```
` ` ` use logger :: LOGGER . use std :: io :: Cursor . LOGGER . init ( " Running Firecracker v . x " . to_string () Box :: new ( logs ) ) ; ` ` `