algostru 0.4.0

Algorithms (algo) and Data Structures (stru)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use log::{Record, Level, Metadata};

pub struct Log;

impl log::Log for Log {
    fn enabled(&self, metadata: &Metadata) -> bool {
        metadata.level() <= Level::Debug
    }

    fn log(&self, record: &Record) {
        if self.enabled(record.metadata()) {
            println!("{:?} - {}", record.level(), record.args());
        }
    }

    fn flush(&self) {}
}