generated from nhcarrigan/template
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.
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user