From 4f98fdc91bc97ca1680daab6fb208d93470ee51a Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 20 May 2019 21:18:45 -0400 Subject: [PATCH] Print errs in red --- src/printer.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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(); } -- 2.30.2