[][src]Struct loggify::Loggify

pub struct Loggify { /* fields omitted */ }

The logger instance To configure the logger, use the LogBuilder struct

Implementations

impl Loggify[src]

pub fn init() -> Result<(), SetLoggerError>[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");
}

pub fn init_with_level(level: Level) -> Result<(), SetLoggerError>[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]

Auto Trait Implementations

impl RefUnwindSafe for Loggify

impl Send for Loggify

impl Sync for Loggify

impl Unpin for Loggify

impl UnwindSafe for Loggify

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.