1
0
Fork 0
kirdy-firmware/src/device/rtt_logger.rs

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) {}
}