Struct redox_log::RedoxLogger
source · pub struct RedoxLogger { /* private fields */ }
Implementations§
source§impl RedoxLogger
impl RedoxLogger
sourcepub fn new() -> Self
pub fn new() -> Self
Examples found in repository?
examples/simple/main.rs (line 7)
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
fn main() {
dbg!(RedoxLogger::new()
.with_output(
OutputBuilder::with_endpoint(
File::create("file.log").expect("failed to open log file")
)
.with_filter(log::LevelFilter::Trace)
.build()
)
.with_output(
OutputBuilder::stdout()
.with_filter(log::LevelFilter::Debug)
.with_ansi_escape_codes()
.build()
)
.with_process_name("simple".into())
.enable().expect("failed to enable"));
info!("Example started");
debug!("example started with log file: {}", "file.log");
trace!("useless comment");
warn!("useless comment is useless");
error!("deadlock");
loop {}
}
sourcepub fn with_output(self, output: Output) -> Self
pub fn with_output(self, output: Output) -> Self
Examples found in repository?
examples/simple/main.rs (lines 8-14)
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
fn main() {
dbg!(RedoxLogger::new()
.with_output(
OutputBuilder::with_endpoint(
File::create("file.log").expect("failed to open log file")
)
.with_filter(log::LevelFilter::Trace)
.build()
)
.with_output(
OutputBuilder::stdout()
.with_filter(log::LevelFilter::Debug)
.with_ansi_escape_codes()
.build()
)
.with_process_name("simple".into())
.enable().expect("failed to enable"));
info!("Example started");
debug!("example started with log file: {}", "file.log");
trace!("useless comment");
warn!("useless comment is useless");
error!("deadlock");
loop {}
}
pub fn with_min_level_override(self, min: LevelFilter) -> Self
pub fn with_max_level_override(self, max: LevelFilter) -> Self
sourcepub fn with_process_name(self, name: String) -> Self
pub fn with_process_name(self, name: String) -> Self
Examples found in repository?
examples/simple/main.rs (line 21)
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
fn main() {
dbg!(RedoxLogger::new()
.with_output(
OutputBuilder::with_endpoint(
File::create("file.log").expect("failed to open log file")
)
.with_filter(log::LevelFilter::Trace)
.build()
)
.with_output(
OutputBuilder::stdout()
.with_filter(log::LevelFilter::Debug)
.with_ansi_escape_codes()
.build()
)
.with_process_name("simple".into())
.enable().expect("failed to enable"));
info!("Example started");
debug!("example started with log file: {}", "file.log");
trace!("useless comment");
warn!("useless comment is useless");
error!("deadlock");
loop {}
}
sourcepub fn enable(self) -> Result<&'static Self, SetLoggerError>
pub fn enable(self) -> Result<&'static Self, SetLoggerError>
Examples found in repository?
examples/simple/main.rs (line 22)
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
fn main() {
dbg!(RedoxLogger::new()
.with_output(
OutputBuilder::with_endpoint(
File::create("file.log").expect("failed to open log file")
)
.with_filter(log::LevelFilter::Trace)
.build()
)
.with_output(
OutputBuilder::stdout()
.with_filter(log::LevelFilter::Debug)
.with_ansi_escape_codes()
.build()
)
.with_process_name("simple".into())
.enable().expect("failed to enable"));
info!("Example started");
debug!("example started with log file: {}", "file.log");
trace!("useless comment");
warn!("useless comment is useless");
error!("deadlock");
loop {}
}
Trait Implementations§
source§impl Debug for RedoxLogger
impl Debug for RedoxLogger
source§impl Default for RedoxLogger
impl Default for RedoxLogger
source§fn default() -> RedoxLogger
fn default() -> RedoxLogger
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for RedoxLogger
impl RefUnwindSafe for RedoxLogger
impl Send for RedoxLogger
impl Sync for RedoxLogger
impl Unpin for RedoxLogger
impl UnwindSafe for RedoxLogger
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