Initial public release

This commit is contained in:
Bohdan Triapitsyn
2025-12-07 19:32:53 +02:00
commit 4b2edf7318
319 changed files with 81600 additions and 0 deletions
@@ -0,0 +1,25 @@
use crate::logging::log_file_path;
use serde::Serialize;
use tokio::fs;
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct DesktopLogFile {
pub file_name: String,
pub content: String,
}
#[tauri::command]
pub async fn fetch_desktop_logs() -> Result<DesktopLogFile, String> {
let path = log_file_path().ok_or_else(|| "Log location unavailable".to_string())?;
let content = fs::read_to_string(&path)
.await
.map_err(|err| format!("Failed to read log file: {err}"))?;
let file_name = path
.file_name()
.and_then(|value| value.to_str())
.unwrap_or("desktop.log")
.to_string();
Ok(DesktopLogFile { file_name, content })
}