Skip to main content

MakeWriter

Trait MakeWriter 

Source
pub trait MakeWriter:
    Send
    + Sync
    + 'static {
    type Writer: Write + Send + 'static;

    // Required method
    fn make_writer(&self) -> Self::Writer;

    // Provided method
    fn make_writer_for(&self, _sev: Severity) -> Self::Writer { ... }
}
Expand description

A factory that yields one io::Write per batch. Cheap to call. Spec 20 § 3.3.

Required Associated Types§

Source

type Writer: Write + Send + 'static

The writer type produced by Self::make_writer; usually Stdout, Stderr, or a guard around a file handle.

Required Methods§

Source

fn make_writer(&self) -> Self::Writer

Yield a writer for this batch.

Provided Methods§

Source

fn make_writer_for(&self, _sev: Severity) -> Self::Writer

Yield a severity-specific writer; defaults to Self::make_writer.

Implementors§