forked from M-Labs/zynq-rs
libsupport_zynq: better logging format (from ARTIQ)
This commit is contained in:
parent
f8782f3f69
commit
61e67520d1
@ -16,8 +16,14 @@ impl log::Log for Logger {
|
||||
}
|
||||
|
||||
fn log(&self, record: &log::Record) {
|
||||
if true || self.enabled(record.metadata()) {
|
||||
println!("{} - {}", record.level(), record.args());
|
||||
if self.enabled(record.metadata()) {
|
||||
// TODO: let timestamp = clock::get_us();
|
||||
let timestamp = 0;
|
||||
let seconds = timestamp / 1_000_000;
|
||||
let micros = timestamp % 1_000_000;
|
||||
|
||||
println!("[{:6}.{:06}s] {:>5}({}): {}",
|
||||
seconds, micros, record.level(), record.target(), record.args());
|
||||
}
|
||||
}
|
||||
fn flush(&self) {
|
||||
|
Loading…
Reference in New Issue
Block a user