Crate slog_term [] [src]

slog-rs'a Drain for terminal output

This crate implements output formatting targeting logging to terminal/console/shell or similar text-based IO.

Using Decorator open trait, user can implement outputting using different colors, terminal types and so on.

#[macro_use]
extern crate slog;
extern crate slog_term;

use slog::*;

fn main() {
    let plain = slog_term::PlainSyncDecorator::new(std::io::stdout());
    let root = Logger::root(
        slog_term::FullFormat::new(plain)
        .build().fuse(), o!()
    );
}

Structs

CompactFormat

Compact terminal-output formatting Drain

CompactFormatBuilder

Streamer builder

FullFormat

Terminal-output formatting Drain

FullFormatBuilder

Streamer builder

PlainDecorator

Plain (no-op) Decorator implementation

PlainRecordDecorator

Record decorator used by PlainDecorator

PlainSyncDecorator

PlainSync Decorator implementation

PlainSyncRecordDecorator

RecordDecorator used by PlainSyncDecorator

TermDecorator

Decorator implemented using term crate

TermDecoratorBuilder

TermDecorator builder

TermRecordDecorator

Record decorator used by TermDecorator

Traits

Decorator

Output decorator

RecordDecorator

Per-record decorator

ThreadSafeTimestampFn

Threadsafe timestamp formatting function type

Functions

term_compact

Create a CompactFormat drain with default settings

term_full

Create a FullFormat drain with default settings

timestamp_local

Default local timezone timestamp function

timestamp_utc

Default UTC timestamp function