pub struct Loggify { /* private fields */ }Expand description
The logger instance
To configure the logger, use the LogBuilder struct
Implementations§
Source§impl Loggify
impl Loggify
Sourcepub fn init() -> Result<(), SetLoggerError>
pub fn init() -> Result<(), SetLoggerError>
Creates a new logger using the default values
§Defaults
level-> The default level isInfoexclude-> 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");
}Sourcepub fn init_with_level(level: Level) -> Result<(), SetLoggerError>
pub fn init_with_level(level: Level) -> Result<(), SetLoggerError>
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§
Auto Trait Implementations§
impl Freeze for Loggify
impl RefUnwindSafe for Loggify
impl Send for Loggify
impl Sync for Loggify
impl Unpin for Loggify
impl UnsafeUnpin for Loggify
impl UnwindSafe for Loggify
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more