projects
/
dnsseed-rust
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5f646d8
)
Print errs in red
author
Matt Corallo
<git@bluematt.me>
Tue, 21 May 2019 01:18:45 +0000
(21:18 -0400)
committer
Matt Corallo
<git@bluematt.me>
Tue, 21 May 2019 01:18:45 +0000
(21:18 -0400)
src/printer.rs
patch
|
blob
|
history
diff --git
a/src/printer.rs
b/src/printer.rs
index 4818d9af61ce4076dddc53de9a349e7cc3051c9f..37411274ce9181b0bec0196e5f7ae3dc64cd27dd 100644
(file)
--- 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();
}