Struct slog_term::PlainDecorator
[−]
[src]
pub struct PlainDecorator<W>(_) where W: Write;
Plain (no-op) Decorator
implementation
This decorator doesn't do any coloring, and doesn't do any synchronization
between threads, so is not Sync
. It is however useful combined with
slog_async::Async
drain, as slog_async::Async
uses only one thread,
and thus requires only Send
from Drain
s it wraps.
#[macro_use] extern crate slog; extern crate slog_term; extern crate slog_async; use slog::*; use slog_async::Async; fn main() { let decorator = slog_term::PlainDecorator::new(std::io::stdout()); let drain = Async::new(slog_term::FullFormat::new(decorator).build().fuse()) .build() .fuse(); }
Methods
impl<W> PlainDecorator<W> where W: Write
[src]
fn new(io: W) -> Self
Create PlainDecorator
instance
Trait Implementations
impl<W> Decorator for PlainDecorator<W> where W: Write + Send + 'static
[src]
fn with_record<F>(&self,
_record: &Record,
_logger_values: &OwnedKVList,
f: F)
-> Result<()> where F: FnOnce(&mut RecordDecorator) -> Result<()>
_record: &Record,
_logger_values: &OwnedKVList,
f: F)
-> Result<()> where F: FnOnce(&mut RecordDecorator) -> Result<()>
Get a RecordDecorator
for a given record
Read more