refactor: replace Console.WriteLine with DiagnosticLog service
All checks were successful
CI / Build (Linux) (push) Successful in 21s

Replace 495+ Console.WriteLine debug statements across handlers, dispatching, services, views, and window components with centralized DiagnosticLog service for proper logging infrastructure. Add new DiagnosticLog.cs service with Debug/Error methods to eliminate debug logging pollution in production code.
This commit is contained in:
2026-03-06 22:06:08 -05:00
parent 08e0c4d2b9
commit e55230c441
70 changed files with 814 additions and 638 deletions

View File

@@ -48,7 +48,7 @@ public static class LinuxProgramHost
// Initialize GTK for WebView support
GtkHostService.Instance.Initialize(options.Title ?? "MAUI Application", options.Width, options.Height);
Console.WriteLine("[LinuxProgramHost] GTK initialized for WebView support");
DiagnosticLog.Debug("LinuxProgramHost", "GTK initialized for WebView support");
// Create Linux application
using var linuxApp = new LinuxApplication();
@@ -79,7 +79,7 @@ public static class LinuxProgramHost
// Fallback to demo if no application view is available
if (rootView == null)
{
Console.WriteLine("No application page found. Showing demo UI.");
DiagnosticLog.Warn("LinuxProgramHost", "No application page found. Showing demo UI.");
rootView = CreateDemoView();
}
@@ -140,8 +140,8 @@ public static class LinuxProgramHost
}
catch (Exception ex)
{
Console.WriteLine($"Error rendering application: {ex.Message}");
Console.WriteLine(ex.StackTrace);
DiagnosticLog.Error("LinuxProgramHost", $"Error rendering application: {ex.Message}");
DiagnosticLog.Error("LinuxProgramHost", ex.StackTrace ?? "");
return null;
}
}