Struct loggify::Loggify [] [src]

pub struct Loggify {
    pub level: Level,
    pub exclude: Vec<String>,
}

Logger

Fields

defines the minimum log level

all targets added are excluded from the logger

Methods

impl Loggify
[src]

[src]

Creates a new logger using the default values

Defaults

  • level -> The default level is Info
  • exclude -> No targets are excluded

Example

#[macro_use]
extern crate log;
extern crate loggify;
 
use loggify::Loggify;
 
fn main() {
    Loggify::init().unwrap();
 
    error!("My error message");
    warn!("My warn message");
    info!("My info message");
    debug!("Will not be shown");
    trace!("Will not be shown");
}

[src]

Same as init but with log level

Example

#[macro_use]
extern crate log;
extern crate loggify;
 
use loggify::Loggify;
 
fn main() {
    Loggify::init_with_level(log::Level::Trace).unwrap();
 
    error!("My error message");
    warn!("My warn message");
    info!("My info message");
    debug!("My debug message");
    trace!("My trace message");
}

Trait Implementations

impl Log for Loggify
[src]

[src]

Determines if a log message with the specified metadata would be logged. Read more

[src]

Logs the Record. Read more

[src]

Flushes any buffered records.

Auto Trait Implementations

impl Send for Loggify

impl Sync for Loggify