1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

add module and line no for Rust logger (#2409)

This commit is contained in:
Bartek Iwańczuk 2019-05-25 18:23:47 +02:00 committed by Ryan Dahl
parent 62c377fc19
commit 73ac5f89f0

View file

@ -64,7 +64,14 @@ impl log::Log for Logger {
fn log(&self, record: &Record) {
if self.enabled(record.metadata()) {
println!("{} RS - {}", record.level(), record.args());
let mut target = record.target().to_string();
if let Some(line_no) = record.line() {
target.push_str(":");
target.push_str(&line_no.to_string());
}
println!("{} RS - {} - {}", record.level(), target, record.args());
}
}
fn flush(&self) {}