Crate quicklog_flush

Source
Expand description

§Flush trait

Simple trait that allows an underlying implementation of Flush to perform some type of IO operation, i.e. writing to file, writing to stdout, etc

§Example usage of Flush

use quicklog_flush::Flush;
impl Quicklog {
    fn flush_logger(&mut self) {
        while let Some(item) = queue.pop_front() {
            let log_string = serialize_into_string(item);
            // flusher implements `Flush` trait
            flusher.flush_one(log_string);
        }
    }
}

Modules§

file_flusher
Flushes to a file
noop_flusher
No-op Flush, does nothing
stdout_flusher
Flushes to stdout through print! macro

Traits§

Flush
Simple trait that allows an underlying implementation of Flush to perform some type of IO operation, i.e. writing to file, writing to stdout, etc