diff --git a/apps/stage-tamagotchi/src-tauri/src/commands.rs b/apps/stage-tamagotchi/src-tauri/src/commands.rs index c6fb4d488..4c79e8f84 100644 --- a/apps/stage-tamagotchi/src-tauri/src/commands.rs +++ b/apps/stage-tamagotchi/src-tauri/src/commands.rs @@ -1,3 +1,4 @@ +use log::debug; use tauri::Manager; use crate::app_windows; @@ -28,6 +29,6 @@ pub async fn open_chat_window(app: tauri::AppHandle) -> Result<(), tauri::Error> #[tauri::command] pub fn debug_println(msg: serde_json::Value) -> Result<(), tauri::Error> { - println!("{msg}"); + debug!("{msg}"); Ok(()) } diff --git a/apps/stage-tamagotchi/src-tauri/src/lib.rs b/apps/stage-tamagotchi/src-tauri/src/lib.rs index 9fb81a774..00c3e10f7 100644 --- a/apps/stage-tamagotchi/src-tauri/src/lib.rs +++ b/apps/stage-tamagotchi/src-tauri/src/lib.rs @@ -1,5 +1,6 @@ use std::{sync::atomic::Ordering, time::Duration}; +use log::info; use tauri::{ Emitter, Manager, @@ -106,11 +107,11 @@ fn load_whisper_model() -> Result { candle_core::Device::Cpu }; - println!("Using device: {device:?}"); + info!("Using device: {device:?}"); let whisper_model = whisper::WhichWhisperModel::Tiny; - println!("Loading whisper model: {:?}", whisper_model); + info!("Loading whisper model: {:?}", whisper_model); let model = whisper::WhisperProcessor::new(whisper_model, device.clone())?; Ok(model) @@ -235,8 +236,8 @@ pub fn run() { .expect("error while building tauri application") .run(|_, event| { if let RunEvent::ExitRequested { .. } = event { - println!("Exiting app"); - println!("Exited app"); + info!("Exiting app"); + info!("Exited app"); } }); } diff --git a/crates/tauri-plugin-mcp/src/lib.rs b/crates/tauri-plugin-mcp/src/lib.rs index 8a4b9a271..643dcfc99 100644 --- a/crates/tauri-plugin-mcp/src/lib.rs +++ b/crates/tauri-plugin-mcp/src/lib.rs @@ -1,5 +1,6 @@ use std::process::Stdio; +use log::info; use rmcp::{ model::{CallToolRequestParam, CallToolResult, Tool}, service::RunningService, @@ -23,7 +24,7 @@ pub struct McpState { #[allow(clippy::missing_panics_doc)] pub fn destroy(app_handle: &AppHandle) { - println!("Destroying MCP plugin"); + info!("Destroying MCP plugin"); tokio::runtime::Runtime::new() .unwrap() @@ -32,7 +33,7 @@ pub fn destroy(app_handle: &AppHandle) { let mut state = state.lock().await; if state.client.is_none() { - println!("MCP plugin not connected, no need to disconnect"); + info!("MCP plugin not connected, no need to disconnect"); return; } @@ -43,7 +44,7 @@ pub fn destroy(app_handle: &AppHandle) { // client.waiting().await.unwrap(); }); - println!("MCP plugin destroyed"); + info!("MCP plugin destroyed"); } #[tauri::command] @@ -82,11 +83,11 @@ async fn disconnect_server(state: State<'_, Mutex>) -> Result<(), Stri } let cancel_result = state.client.take().unwrap().cancel().await; - println!("Cancel result: {cancel_result:?}"); + info!("Cancel result: {cancel_result:?}"); // state.client.take().unwrap().waiting().await.unwrap(); drop(state); - println!("Disconnected from MCP server"); + info!("Disconnected from MCP server"); Ok(()) } @@ -116,8 +117,8 @@ async fn call_tool( name: String, args: Option>, ) -> Result { - println!("Calling tool: {name:?}"); - println!("Arguments: {args:?}"); + info!("Calling tool: {name:?}"); + info!("Arguments: {args:?}"); let state = state.lock().await; let client = state.client.as_ref(); @@ -135,7 +136,7 @@ async fn call_tool( .unwrap(); drop(state); - println!("Tool result: {call_tool_result:?}"); + info!("Tool result: {call_tool_result:?}"); Ok(call_tool_result) } @@ -146,7 +147,7 @@ pub struct Builder; impl Builder { #[must_use] pub fn build(self) -> TauriPlugin { - println!("Building MCP plugin"); + info!("Building MCP plugin"); plugin::Builder::new("mcp") .invoke_handler(tauri::generate_handler![