use slog::Level;
pub struct ColorPalette {
pub critical: &'static str,
pub error: &'static str,
pub warning: &'static str,
pub info: &'static str,
pub debug: &'static str,
pub trace: &'static str,
}
impl ColorPalette {
pub fn level_to_color(&self, level: Level) -> &'static str {
use slog::Level::*;
match level {
Critical => self.critical,
Error => self.error,
Warning => self.warning,
Info => self.info,
Debug => self.debug,
Trace => self.trace,
}
}
}
impl Default for ColorPalette {
fn default() -> Self {
ColorPalette {
critical: "ff0000",
error: "ff5500",
warning: "ffaa00",
info: "55aa00",
debug: "55557f",
trace: "aaaa7f",
}
}
}