pub fn init(mut self) -> Result<(), SetLoggerError> {
        // If there is no level, line number, or module path in the tag, then the tag will always
        // be empty. The separator should also be empty so only the message component is printed
        // for the log statement; otherwise, there is a weird floating colon in front of every log
        // statement.
        //
        // It is better to do it here than in the `log` function because it only has to be
        // determined once at initialization as opposed to every call to the `log` function. So
        // a potentially slight performance improvement.
        if !self.include_level && !self.include_line_numbers && !self.include_module_path {
            self.separator = String::new();
        }
        // The level is set based on verbosity only if the `verbosity` method has been used and
        // _not_ overwridden a later call to the `max_level` method. If neither the `verbosity` or
        // `max_level` method is used, then the `DEFAULT_LEVEL` is used because it is set with the
        // `new` function. It makes more sense to calculate the level based on verbosity _after_
        // all configuration methods have been called as opposed to during the call to the
        // `verbosity` method. This change enables the offset feature so that the `max_level`
        // method can be used at any time during the "building" procedure before the call to
        // `init`. Otherwise, calling the `max_level` _after_ the `verbosity` method would have no
        // effect and be difficult to communicate this limitation to users.
        if let Some(v) = self.verbosity {
            self.level = match v + self.offset {
                0 => log::Level::Error,
                1 => log::Level::Warn,
                2 => log::Level::Info,
                3 => log::Level::Debug,
                _ => log::Level::Trace,
            };
        }
        log::set_max_level(self.level.to_level_filter());
        log::set_boxed_logger(Box::new(self))
    }
/// Initializes the logger.
///
/// This also consumes the logger. It cannot be further modified after initialization.
///
/// # Example
///
/// ```rust
/// #[macro_use] extern crate log;
/// extern crate loggerv;
///
/// fn main() {
///     loggerv::Logger::new()
///         .init()
///         .unwrap();
///
///     error!("This is printed to stderr");
///     warn!("This is printed to stderr");
///     info!("This is not printed to stdout");
///     debug!("This is not printed to stdout");
///     trace!("This is not printed to stdout");
/// }
/// ```
///
/// # Example
///
/// If the tag will be empty because the level, line numbers, and module path were all
/// disabled, then the separator is changed to the empty string to avoid writing a long
/// character in front of each message for each log statement.
///
///
/// ```rust
/// #[macro_use] extern crate log;
/// extern crate loggerv;
///
/// fn main() {
///     loggerv::Logger::new()
///         .module_path(false)
///         .level(false)
///         .line_numbers(false)
///         .init()
///         .unwrap();
///
///     error!("This is printed to stderr without the separator");
///     warn!("This is printed to stderr without the separator");
///     info!("This is not printed to stdout");
///     debug!("This is not printed to stdout");
///     trace!("This is not printed to stdout");
/// }
/// ```
Initializes the logger.
This also consumes the logger. It cannot be further modified after initialization.
Initializes the logger . This also consumes the logger . It cannot be further modified after initialization .
pub fn init(mut self) -> Result<(), SetLoggerError> {
        // If there is no level, line number, or module path in the tag, then the tag will always
        // be empty. The separator should also be empty so only the message component is printed
        // for the log statement; otherwise, there is a weird floating colon in front of every log
        // statement.
        //
        // It is better to do it here than in the `log` function because it only has to be
        // determined once at initialization as opposed to every call to the `log` function. So
        // a potentially slight performance improvement.
        if !self.include_level && !self.include_line_numbers && !self.include_module_path {
            self.separator = String::new();
        }
        // The level is set based on verbosity only if the `verbosity` method has been used and
        // _not_ overwridden a later call to the `max_level` method. If neither the `verbosity` or
        // `max_level` method is used, then the `DEFAULT_LEVEL` is used because it is set with the
        // `new` function. It makes more sense to calculate the level based on verbosity _after_
        // all configuration methods have been called as opposed to during the call to the
        // `verbosity` method. This change enables the offset feature so that the `max_level`
        // method can be used at any time during the "building" procedure before the call to
        // `init`. Otherwise, calling the `max_level` _after_ the `verbosity` method would have no
        // effect and be difficult to communicate this limitation to users.
        if let Some(v) = self.verbosity {
            self.level = match v + self.offset {
                0 => log::Level::Error,
                1 => log::Level::Warn,
                2 => log::Level::Info,
                3 => log::Level::Debug,
                _ => log::Level::Trace,
            };
        }
        log::set_max_level(self.level.to_level_filter());
        log::set_boxed_logger(Box::new(self))
    }
pub fn init ( mut self ) -> Result < ( ) , SetLoggerError > { // If there is no level, line number, or module path in the tag, then the tag will always // be empty. The separator should also be empty so only the message component is printed // for the log statement; otherwise, there is a weird floating colon in front of every log // statement. // // It is better to do it here than in the `log` function because it only has to be // determined once at initialization as opposed to every call to the `log` function. So // a potentially slight performance improvement. if ! self . include_level && ! self . include_line_numbers && ! self . include_module_path { self . separator = String :: new ( ) ; } // The level is set based on verbosity only if the `verbosity` method has been used and // _not_ overwridden a later call to the `max_level` method. If neither the `verbosity` or // `max_level` method is used, then the `DEFAULT_LEVEL` is used because it is set with the // `new` function. It makes more sense to calculate the level based on verbosity _after_ // all configuration methods have been called as opposed to during the call to the // `verbosity` method. This change enables the offset feature so that the `max_level` // method can be used at any time during the "building" procedure before the call to // `init`. Otherwise, calling the `max_level` _after_ the `verbosity` method would have no // effect and be difficult to communicate this limitation to users. if let Some ( v ) = self . verbosity { self . level = match v + self . offset { 0 => log :: Level :: Error , 1 => log :: Level :: Warn , 2 => log :: Level :: Info , 3 => log :: Level :: Debug , _ => log :: Level :: Trace , } ; } log :: set_max_level ( self . level . to_level_filter ( ) ) ; log :: set_boxed_logger ( Box :: new ( self ) ) }
Initializes the logger.
Initializes the logger .
mut self
example
None
[macro_use] extern crate log;
extern crate loggerv.

fn main() {
loggerv::Logger::new()
.init()
.unwrap().

error!("This is printed to stderr");
warn!("This is printed to stderr");
info!("This is not printed to stdout");
debug!("This is not printed to stdout");
trace!("This is not printed to stdout");
}
```
extern crate loggerv . fn main () { loggerv :: Logger :: new () . init () . unwrap () . error! ( " This is printed to stderr " ) ; warn! ( " This is printed to stderr " ) ; info! ( " This is not printed to stdout " ) ; debug! ( " This is not printed to stdout " ) ; trace! ( " This is not printed to stdout " ) ; } ` ` `
example
If the tag will be empty because the level, line numbers, and module path were all
disabled, then the separator is changed to the empty string to avoid writing a long
character in front of each message for each log statement.


If the tag will be empty because the level line numbers and module path were all disabled then the separator is changed to the empty string to avoid writing a long character in front of each message for each log statement .
[macro_use] extern crate log;
extern crate loggerv.

fn main() {
loggerv::Logger::new()
.module_path(false)
.level(false)
.line_numbers(false)
.init()
.unwrap().

error!("This is printed to stderr without the separator");
warn!("This is printed to stderr without the separator");
info!("This is not printed to stdout");
debug!("This is not printed to stdout");
trace!("This is not printed to stdout");
}
```
extern crate loggerv . fn main () { loggerv :: Logger :: new () . module_path ( false ) . level ( false ) . line_numbers ( false ) . init () . unwrap () . error! ( " This is printed to stderr without the separator " ) ; warn! ( " This is printed to stderr without the separator " ) ; info! ( " This is not printed to stdout " ) ; debug! ( " This is not printed to stdout " ) ; trace! ( " This is not printed to stdout " ) ; } ` ` `