pub struct OutputBuilder { /* private fields */ }

Implementations§

source§

impl OutputBuilder

source

pub fn in_redox_logging_scheme<A, B, C>( category: A, subcategory: B, logfile: C ) -> Result<Self, Error>
where A: AsRef<OsStr>, B: AsRef<OsStr>, C: AsRef<OsStr>,

source

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 {}
}
source

pub fn stderr() -> Self

source

pub fn with_endpoint<T>(endpoint: T) -> Self
where T: Write + Send + 'static,

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 {}
}
source

pub fn with_dyn_endpoint(endpoint: Box<dyn Write + Send + 'static>) -> Self

source

pub fn flush_on_newline(self, flush: bool) -> Self

source

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 {}
}
source

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 {}
}
source

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§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.