From: Matt Corallo Date: Tue, 21 May 2019 01:18:45 +0000 (-0400) Subject: Print errs in red X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;ds=sidebyside;h=4f98fdc91bc97ca1680daab6fb208d93470ee51a;p=dnsseed-rust Print errs in red --- diff --git a/src/printer.rs b/src/printer.rs index 4818d9a..3741127 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -149,9 +149,13 @@ impl Printer { } } - pub fn add_line(&self, line: String, _err: bool) { + pub fn add_line(&self, line: String, err: bool) { let mut stats = self.stats.lock().unwrap(); - stats.lines.push_back(line); + if err { + stats.lines.push_back("\x1b[31m".to_string() + &line + "\x1b[0m"); + } else { + stats.lines.push_back(line); + } if stats.lines.len() > 50 { stats.lines.pop_front(); }