use std::borrow::Cow;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Level {
Debug,
Info,
Success,
Warn,
Error,
Critical,
Fatal,
}
impl From<Level> for Cow<'static, str> {
fn from(level: Level) -> Self {
match level {
Level::Debug => Cow::Borrowed("DEBUG"),
Level::Info => Cow::Borrowed("INFO"),
Level::Success => Cow::Borrowed("SUCCESS"),
Level::Warn => Cow::Borrowed("WARN"),
Level::Error => Cow::Borrowed("ERROR"),
Level::Critical => Cow::Borrowed("CRITICAL"),
Level::Fatal => Cow::Borrowed("FATAL"),
}
}
}