From 4078b2b6405de3e07e7622946dc32abe0c7475a6 Mon Sep 17 00:00:00 2001 From: Hikari Date: Fri, 6 Feb 2026 23:00:25 -0800 Subject: [PATCH] fix: remove redundant fmt layer that outputs to hidden stdout In production builds with windows_subsystem = "windows", stdout is suppressed. The fmt::layer() was outputting to this hidden stdout, making logs invisible. Now all tracing logs only go through TauriLogLayer to the debug console. NOTE: There are still many println!/eprintln! calls throughout the codebase that bypass tracing entirely. These should be gradually migrated to use tracing::info!/tracing::error! macros for visibility in production builds. --- src-tauri/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index d9a0a9d..9dfc5fa 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -63,9 +63,10 @@ pub fn run() { .manage(discord_rpc.clone()) .setup(move |app| { // Initialize tracing with custom layer that emits to frontend + // NOTE: We don't use fmt::layer() because in production builds with windows_subsystem = "windows", + // stdout is hidden. Instead, all logs go through TauriLogLayer to the debug console. let tauri_layer = TauriLogLayer::new(app.handle().clone()); tracing_subscriber::registry() - .with(tracing_subscriber::fmt::layer()) .with(tauri_layer) .init();