use crate::devices::device::DeviceId; use crate::logs::severity::LogSeverity; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone)] pub struct LogEntry { /// If no device is specified then the message comes from the backend pub device_id: Option, pub time: u64, pub severity: LogSeverity, pub message: String, } impl LogEntry { pub fn serialize(&self) -> anyhow::Result { Ok(serde_json::to_string(self)?) } }