feat: add trace debug level

This commit is contained in:
Gabriele Musco 2023-06-24 00:27:43 +02:00
commit 492aeddc2e
No known key found for this signature in database
GPG key ID: 1068D795C80E51DE

View file

@ -5,6 +5,7 @@ use relm4_icons::icon_name;
#[derive(Debug)] #[derive(Debug)]
pub enum DebugLevel { pub enum DebugLevel {
Trace,
Debug, Debug,
Info, Info,
Warning, Warning,
@ -14,6 +15,7 @@ pub enum DebugLevel {
impl DebugLevel { impl DebugLevel {
pub fn from_string(s: String) -> Self { pub fn from_string(s: String) -> Self {
match s.to_lowercase().as_str() { match s.to_lowercase().as_str() {
"trace" => Self::Trace,
"debug" => Self::Debug, "debug" => Self::Debug,
"info" => Self::Info, "info" => Self::Info,
"warning" => Self::Warning, "warning" => Self::Warning,
@ -23,7 +25,7 @@ impl DebugLevel {
} }
} }
pub const DEBUG_LEVEL_STRINGS: [&str; 4] = ["Debug", "Info", "Warning", "Error"]; pub const DEBUG_LEVEL_STRINGS: [&str; 5] = ["Trace", "Debug", "Info", "Warning", "Error"];
#[derive(Debug)] #[derive(Debug)]
pub enum DebugViewMsg { pub enum DebugViewMsg {