Skip to content

Commit 9b9f02f

Browse files
committed
[main] add ANSI color, new formatting for std stream output
1 parent 07a0295 commit 9b9f02f

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

src/main.rs

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use std::process::{self, Command};
1515
use std::str::FromStr;
1616

1717
use chrono::{Date, DateTime, Duration, Utc};
18+
use colored::*;
1819
use failure::{bail, format_err, Fail, Error};
1920
use log::debug;
2021
use reqwest::blocking::Client;
@@ -634,7 +635,13 @@ fn print_results(cfg: &Config, client: &Client, bisection_result: &BisectionResu
634635
}
635636
}
636637

637-
eprintln!("regression in {}", toolchains[*found]);
638+
let tc_found = format!("Regression in {}", toolchains[*found]);
639+
eprintln!("");
640+
eprintln!("");
641+
eprintln!("{}", "*".repeat(80).dimmed().bold());
642+
eprintln!("{}", tc_found.red());
643+
eprintln!("{}", "*".repeat(80).dimmed().bold());
644+
eprintln!("");
638645
}
639646

640647
fn print_final_report(
@@ -653,14 +660,16 @@ fn print_final_report(
653660
..
654661
} = ci_bisection_result;
655662

656-
eprintln!("");
657-
eprintln!("");
658-
659-
eprintln!("==================================================================================");
660-
eprintln!("= Please open an issue on Rust's github repository =");
661-
eprintln!("= https://github.com/rust-lang/rust/issues/new =");
662-
eprintln!("= Below you will find a text that would serve as a starting point of your report =");
663-
eprintln!("==================================================================================");
663+
#[rustfmt::skip]
664+
eprintln!("{}", "==================================================================================".dimmed());
665+
#[rustfmt::skip]
666+
eprintln!("{}", "= Please open an issue on Rust's github repository =".dimmed());
667+
#[rustfmt::skip]
668+
eprintln!("{}", "= https://github.com/rust-lang/rust/issues/new =".dimmed());
669+
#[rustfmt::skip]
670+
eprintln!("{}", "= Below you will find a text that would serve as a starting point of your report =".dimmed());
671+
#[rustfmt::skip]
672+
eprintln!("{}", "==================================================================================".dimmed());
664673

665674
eprintln!("");
666675

@@ -1071,6 +1080,7 @@ fn bisect_ci_in_commits(
10711080
}
10721081

10731082
eprintln!("validated commits found, specifying toolchains");
1083+
eprintln!("");
10741084

10751085
let toolchains = commits
10761086
.into_iter()
@@ -1142,7 +1152,8 @@ fn main() {
11421152
match err.downcast::<ExitError>() {
11431153
Ok(ExitError(code)) => process::exit(code),
11441154
Err(err) => {
1145-
eprintln!("ERROR: {}", err);
1155+
let error_str = "ERROR:".red().bold();
1156+
eprintln!("{} {}", error_str, err);
11461157
process::exit(1);
11471158
}
11481159
}

0 commit comments

Comments
 (0)