Skip to content

Commit

Permalink
add module and line no for Rust logger (denoland#2409)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju authored and ry committed May 25, 2019
1 parent 62c377f commit 73ac5f8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cli/main.rs
Expand Up @@ -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) {}
Expand Down

0 comments on commit 73ac5f8

Please sign in to comment.