summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2019-05-25 18:23:47 +0200
committerRyan Dahl <ry@tinyclouds.org>2019-05-25 19:23:47 +0300
commit73ac5f89f022a3965c68705cef284386a9365419 (patch)
tree9b5f11cafbb9b59230f65619cb680e29052bfd0d
parent62c377fc19ac49138da5c3b3ee3b9d3854a44474 (diff)
add module and line no for Rust logger (#2409)
-rw-r--r--cli/main.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/cli/main.rs b/cli/main.rs
index 3ee8fb0ed..5d70805ae 100644
--- a/cli/main.rs
+++ b/cli/main.rs
@@ -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) {}