Struct jlogger::JloggerBuilder
source · [−]pub struct JloggerBuilder { /* private fields */ }
Implementations
sourceimpl JloggerBuilder
impl JloggerBuilder
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new JloggerBuilder which is used to build a Jlogger.
Examples
use log::LevelFilter;
use jlogger::JloggerBuilder;
JloggerBuilder::new()
.max_level(LevelFilter::Debug)
.log_console(true)
.log_mark(true)
.log_file("/tmp/mylog.log")
.build();
sourcepub fn max_level(self, max_level: LevelFilter) -> Self
pub fn max_level(self, max_level: LevelFilter) -> Self
Set the max level to be outputed. Log messages with a level below it will not be outputed. At runtime, the log level can be filterred though “JLOGGER_LEVEL” environment variable.
sourcepub fn log_console(self, log_console: bool) -> Self
pub fn log_console(self, log_console: bool) -> Self
If enabled, log message will be printed to the console. Default is true.
sourcepub fn log_file(self, log_file: &str) -> Self
pub fn log_file(self, log_file: &str) -> Self
Log file name. If specifed, log message will be outputed to it.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for JloggerBuilder
impl Send for JloggerBuilder
impl Sync for JloggerBuilder
impl Unpin for JloggerBuilder
impl UnwindSafe for JloggerBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more