projects
/
dnsseed-rust
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Print errs in red
[dnsseed-rust]
/
src
/
printer.rs
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();
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();
}
if stats.lines.len() > 50 {
stats.lines.pop_front();
}