Struct fern::Output [] [src]

pub struct Output(_);

Configuration for a logger output.

Methods

impl Output
[src]

Returns a file logger using a custom separator.

If the default separator of \n is acceptable, an fs::File instance can be passed into Dispatch::chain directly.

fern::Dispatch::new()
    .chain(std::fs::File::create("log")?)
fern::Dispatch::new()
    .chain(fern::log_file("log")?)

Example usage (using fern::log_file):

fern::Dispatch::new()
    .chain(fern::Output::file(fern::log_file("log")?, "\r\n"))

Returns an stdout logger using a custom separator.

If the default separator of \n is acceptable, an io::Stdout instance can be passed into Dispatch::chain() directly.

fern::Dispatch::new()
    .chain(std::io::stdout())

Returns an stderr logger using a custom separator.

If the default separator of \n is acceptable, an io::Stderr instance can be passed into Dispatch::chain() directly.

fern::Dispatch::new()
    .chain(std::io::stderr())

Trait Implementations

impl From<Dispatch> for Output
[src]

Creates an output logger forwarding all messages to the dispatch.

impl From<SharedDispatch> for Output
[src]

Creates an output logger forwarding all messages to the dispatch.

impl From<Box<FernLog>> for Output
[src]

Creates an output logger forwarding all messages to the custom logger.

impl From<File> for Output
[src]

Creates an output logger which writes all messages to the file with \n as the separator.

File writes are buffered and flushed once per log record.

impl From<Stdout> for Output
[src]

Creates an output logger which writes all messages to stdout with the given handle and \n as the separator.

impl From<Stderr> for Output
[src]

Creates an output logger which writes all messages to stderr with the given handle and \n as the separator.

impl Debug for Output
[src]

Formats the value using the given formatter.