#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum NoticeLevel {
Debug,
Log,
Info,
Notice,
Warning,
}
impl NoticeLevel {
pub const fn as_str(self) -> &'static str {
match self {
NoticeLevel::Debug => "DEBUG",
NoticeLevel::Log => "LOG",
NoticeLevel::Info => "INFO",
NoticeLevel::Notice => "NOTICE",
NoticeLevel::Warning => "WARNING",
}
}
pub const fn default_sqlstate(self) -> &'static str {
match self {
NoticeLevel::Warning => "01000",
NoticeLevel::Debug | NoticeLevel::Log | NoticeLevel::Info | NoticeLevel::Notice => {
"00000"
}
}
}
}