The level padded to five columns, in `env_logger`'s colors.
(level: &Level)
| 44 | |
| 45 | /// The level padded to five columns, in `env_logger`'s colors. |
| 46 | fn level_label(level: &Level) -> console::StyledObject<String> { |
| 47 | let style = match *level { |
| 48 | Level::ERROR => console::Style::new().red(), |
| 49 | Level::WARN => console::Style::new().yellow(), |
| 50 | Level::INFO => console::Style::new().green(), |
| 51 | Level::DEBUG => console::Style::new().blue(), |
| 52 | Level::TRACE => console::Style::new().cyan(), |
| 53 | }; |
| 54 | style |
| 55 | .for_stderr() |
| 56 | .apply_to(format!("{:<5}", level.as_str())) |
| 57 | } |
| 58 | |
| 59 | #[cfg(test)] |
| 60 | mod tests { |
nothing calls this directly
no outgoing calls
no test coverage detected