pref: 提高LogEvent的效率(移除发送前的反序列化步骤)

This commit is contained in:
lanyeeee
2026-03-05 04:30:09 +08:00
parent 32c175ec2e
commit 15cdb30763
8 changed files with 86 additions and 58 deletions
+4 -12
View File
@@ -1,23 +1,15 @@
use std::collections::HashMap;
use serde::{Deserialize, Serialize};
use specta::Type;
use tauri_specta::Event;
use crate::{
downloader::{download_progress::DownloadProgress, download_task_state::DownloadTaskState},
types::log_level::LogLevel,
use crate::downloader::{
download_progress::DownloadProgress, download_task_state::DownloadTaskState,
};
#[derive(Debug, Clone, Serialize, Deserialize, Type, Event)]
#[serde(rename_all = "camelCase")]
pub struct LogEvent {
pub timestamp: String,
pub level: LogLevel,
pub fields: HashMap<String, serde_json::Value>,
pub target: String,
pub filename: String,
#[serde(rename = "line_number")]
pub line_number: i64,
pub json_raw: String,
}
#[derive(Debug, Clone, Serialize, Deserialize, Type, Event)]