From dbad96b5ab34a009732227becb50803fb8c1993a Mon Sep 17 00:00:00 2001 From: Subhamoy Biswas Date: Mon, 2 Mar 2026 13:08:54 +0530 Subject: [PATCH] refactor: debug rust side opener command --- src-tauri/src/lib.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 4c72628..4441e34 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -31,6 +31,7 @@ use tokio::{ time::sleep, }; use tokio_tungstenite::accept_async; +use log::{info, error}; struct ImageCache(StdMutex>); @@ -361,17 +362,23 @@ async fn open_file_with_app( return app_handle .opener() .reveal_item_in_dir(file_path) - .map_err(|e| e.to_string()); + .map_err(|e| { + error!("Failed to reveal file in explorer: {}", e); + e.to_string() + }); } - println!("Opening file: {} with app: {}", file_path, name); + info!("Opening file: {} with app: {}", file_path, name); } else { - println!("Opening file: {} with default app", file_path); + info!("Opening file: {} with default app", file_path); } app_handle .opener() .open_path(file_path, app_name) - .map_err(|e| e.to_string()) + .map_err(|e| { + error!("Failed to open file: {}", e); + e.to_string() + }) } #[tauri::command]