/// Initialize `env_logger` and set the log level for the given package.
///
/// All other modules default to printing warnings.
Initialize `env_logger` and set the log level for the given package.
All other modules default to printing warnings.
Initialize ` env_logger ` and set the log level for the given package . All other modules default to printing warnings .
pub fn log(
    &self,
    level: Option<Level>,
    own_pkg_name: &str,
  ) -> Result<(), Error> {
    let level_filter = match level {
      Some(level) => level.to_level_filter(),
      None => return Ok(()),
    };
    init_builder(self.pretty)?
      .filter(Some(&own_pkg_name.replace("-", "_")), level_filter)
      .filter(None, Level::Warn.to_level_filter())
      .try_init()?;
    Ok(())
  }
pub fn log ( & self , level : Option < Level > , own_pkg_name : & str , ) -> Result < ( ) , Error > { let level_filter = match level { Some ( level ) => level . to_level_filter ( ) , None => return Ok ( ( ) ) , } ; init_builder ( self . pretty ) ? . filter ( Some ( & own_pkg_name . replace ( " " , " " ) ) , level_filter ) . filter ( None , Level :: Warn . to_level_filter ( ) ) . try_init ( ) ? ; Ok ( ( ) ) }
Initialize `env_logger` and set the log level for the given package.
Initialize ` env_logger ` and set the log level for the given package .
&self
level
Option<Level>
own_pkg_name
&str