use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum LogLevel {
Exec,
Error,
Info,
Debug,
Warn,
Time,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MonitoringEvent {
pub event_id: String,
pub timestamp: DateTime<Utc>,
pub duration_ms: Option<u64>,
pub level: LogLevel,
pub message: String,
pub data: Option<serde_json::Value>,
pub correlation_id: String,
}
#[async_trait::async_trait]
pub trait ILogMonitor: Send + Sync {
async fn log(&self, event: MonitoringEvent) -> anyhow::Result<()>;
async fn flush(&self) -> anyhow::Result<()>;
}