refactor(logging): replace log_err! with structured logging_error! calls

refactor(cm-service): better error handling from Backend to Frontend
This commit is contained in:
Tunglies
2025-03-28 03:39:21 +08:00
parent 59caa22431
commit e8e16f7d57
18 changed files with 232 additions and 128 deletions

View File

@@ -2,23 +2,37 @@ use std::fmt;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Type {
Cmd,
Core,
Config,
Setup,
System,
Service,
Hotkey,
Window,
Config,
CMD,
Tray,
Timer,
Frontend,
Backup,
Lightweight,
}
impl fmt::Display for Type {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Type::Cmd => write!(f, "[Cmd]"),
Type::Core => write!(f, "[Core]"),
Type::Config => write!(f, "[Config]"),
Type::Setup => write!(f, "[Setup]"),
Type::System => write!(f, "[System]"),
Type::Service => write!(f, "[Service]"),
Type::Hotkey => write!(f, "[Hotkey]"),
Type::Window => write!(f, "[Window]"),
Type::Config => write!(f, "[Config]"),
Type::CMD => write!(f, "[CMD]"),
Type::Tray => write!(f, "[Tray]"),
Type::Timer => write!(f, "[Timer]"),
Type::Frontend => write!(f, "[Frontend]"),
Type::Backup => write!(f, "[Backup]"),
Type::Lightweight => write!(f, "[Lightweight]"),
}
}
}