From 5f99b7df057568a0f2a432a3d261758e61097e5a Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Fri, 8 Aug 2025 13:00:38 -0700 Subject: [PATCH] Use logger for plugin logs so they actually show https://feedback.yaak.app/p/log-statements-dont-appear-from-within-plugins --- src-tauri/yaak-plugins/src/nodejs.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src-tauri/yaak-plugins/src/nodejs.rs b/src-tauri/yaak-plugins/src/nodejs.rs index 853a8609..0b55444d 100644 --- a/src-tauri/yaak-plugins/src/nodejs.rs +++ b/src-tauri/yaak-plugins/src/nodejs.rs @@ -1,12 +1,12 @@ use crate::error::Result; -use log::info; +use log::{info, warn}; use serde; use serde::Deserialize; use std::net::SocketAddr; use tauri::path::BaseDirectory; use tauri::{AppHandle, Manager, Runtime}; -use tauri_plugin_shell::process::CommandEvent; use tauri_plugin_shell::ShellExt; +use tauri_plugin_shell::process::CommandEvent; use tokio::sync::watch::Receiver; #[derive(Deserialize, Default)] @@ -44,10 +44,10 @@ pub async fn start_nodejs_plugin_runtime( while let Some(event) = child_rx.recv().await { match event { CommandEvent::Stderr(line) => { - print!("{}", String::from_utf8(line).unwrap()); + warn!("{}", String::from_utf8_lossy(&line).trim_end_matches(&['\n', '\r'][..])); } CommandEvent::Stdout(line) => { - print!("{}", String::from_utf8(line).unwrap()); + info!("{}", String::from_utf8_lossy(&line).trim_end_matches(&['\n', '\r'][..])); } _ => {} }