hex_patch/app/settings/
verbosity.rs1use serde::{Deserialize, Serialize};
2
3use crate::app::log::NotificationLevel;
4
5#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
6#[serde(rename_all = "lowercase")]
7pub enum Verbosity {
8 Debug,
9 #[default]
10 Info,
11 Warning,
12 Error,
13}
14
15impl Verbosity {
16 pub fn as_notification_level(&self) -> NotificationLevel {
17 match self {
18 Verbosity::Debug => NotificationLevel::Debug,
19 Verbosity::Info => NotificationLevel::Info,
20 Verbosity::Warning => NotificationLevel::Warning,
21 Verbosity::Error => NotificationLevel::Error,
22 }
23 }
24}