Skip to content

Commit

Permalink
Use bold in CLI colors (#143)
Browse files Browse the repository at this point in the history
Makes warnings/errors a bit more visible.
  • Loading branch information
intgr authored Jun 26, 2023
1 parent bfdef4a commit df3c119
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ use std::fmt;
/// Shorter alias for `Box<dyn Error>`
pub type AnyErr = Box<dyn Error>;

const COLOR_HINT: Style = Style::new().fg_color(Some(Color::Ansi(AnsiColor::Green)));
const COLOR_HINT: Style = Style::new()
.fg_color(Some(Color::Ansi(AnsiColor::Green)))
.bold();

/// Advanced error type that can supply hints to the user
#[derive(Debug)]
Expand Down
8 changes: 6 additions & 2 deletions src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ struct SimpleLogger {
}

const COLOR_TRACE: Style = Style::new().fg_color(Some(Color::Ansi(AnsiColor::Magenta)));
const COLOR_WARN: Style = Style::new().fg_color(Some(Color::Ansi(AnsiColor::Yellow)));
const COLOR_ERROR: Style = Style::new().fg_color(Some(Color::Ansi(AnsiColor::Red)));
const COLOR_WARN: Style = Style::new()
.fg_color(Some(Color::Ansi(AnsiColor::Yellow)))
.bold();
const COLOR_ERROR: Style = Style::new()
.fg_color(Some(Color::Ansi(AnsiColor::Red)))
.bold();

impl Log for SimpleLogger {
fn enabled(&self, metadata: &Metadata) -> bool {
Expand Down

0 comments on commit df3c119

Please sign in to comment.