1use std::time::Instant;
2
3use ratatui::style::Color;
4
5#[derive(Debug, Clone, Copy, PartialEq)]
7pub enum LogLevel {
8 Debug,
9 Info,
10 Warning,
11 Error,
12}
13
14impl LogLevel {
15 pub fn color(self) -> Color {
17 match self {
18 LogLevel::Debug => Color::DarkGray,
19 LogLevel::Info => Color::Gray,
20 LogLevel::Warning => Color::Yellow,
21 LogLevel::Error => Color::Red,
22 }
23 }
24}
25
26#[derive(Debug, Clone)]
28pub struct LogEntry {
29 pub timestamp: String,
30 pub level: LogLevel,
31 pub message: String,
32 pub created_at: Instant,
34}