X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fprinter.rs;h=37411274ce9181b0bec0196e5f7ae3dc64cd27dd;hb=4f98fdc91bc97ca1680daab6fb208d93470ee51a;hp=4818d9af61ce4076dddc53de9a349e7cc3051c9f;hpb=5f646d85f173e2274d12765633a5b6b21450b7d3;p=dnsseed-rust 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(); }