forked from M-Labs/kirdy
19 lines
358 B
Rust
19 lines
358 B
Rust
|
use log::{Log, Metadata, Record};
|
||
|
use rtt_target::rprintln;
|
||
|
|
||
|
pub struct Logger;
|
||
|
|
||
|
impl Log for Logger {
|
||
|
fn enabled(&self, _: &Metadata) -> bool {
|
||
|
true
|
||
|
}
|
||
|
|
||
|
fn log(&self, record: &Record) {
|
||
|
if self.enabled(record.metadata()) {
|
||
|
rprintln!("{} - {}", record.level(), record.args());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
fn flush(&self) {}
|
||
|
}
|