Struct redox_log::OutputBuilder
source · pub struct OutputBuilder { /* private fields */ }Implementations§
source§impl OutputBuilder
impl OutputBuilder
pub fn in_redox_logging_scheme<A, B, C>( category: A, subcategory: B, logfile: C ) -> Result<Self, Error>
sourcepub fn stdout() -> Self
pub fn stdout() -> Self
Examples found in repository?
examples/simple/main.rs (line 16)
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 stderr() -> Self
sourcepub fn with_endpoint<T>(endpoint: T) -> Self
pub fn with_endpoint<T>(endpoint: T) -> Self
Examples found in repository?
examples/simple/main.rs (lines 9-11)
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_dyn_endpoint(endpoint: Box<dyn Write + Send + 'static>) -> Self
pub fn flush_on_newline(self, flush: bool) -> Self
sourcepub fn with_filter(self, filter: LevelFilter) -> Self
pub fn with_filter(self, filter: LevelFilter) -> Self
Examples found in repository?
examples/simple/main.rs (line 12)
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_ansi_escape_codes(self) -> Self
pub fn with_ansi_escape_codes(self) -> Self
Examples found in repository?
examples/simple/main.rs (line 18)
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 build(self) -> Output
pub fn build(self) -> Output
Examples found in repository?
examples/simple/main.rs (line 13)
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 {}
}Auto Trait Implementations§
impl Freeze for OutputBuilder
impl !RefUnwindSafe for OutputBuilder
impl Send for OutputBuilder
impl !Sync for OutputBuilder
impl Unpin for OutputBuilder
impl !UnwindSafe for OutputBuilder
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