refactor: replace Console.WriteLine with DiagnosticLog service
All checks were successful
CI / Build (Linux) (push) Successful in 21s
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:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using Microsoft.Maui.Dispatching;
|
||||
using Microsoft.Maui.Platform.Linux.Native;
|
||||
using Microsoft.Maui.Platform.Linux.Services;
|
||||
|
||||
namespace Microsoft.Maui.Platform.Linux.Dispatching;
|
||||
|
||||
@@ -24,7 +25,7 @@ public class LinuxDispatcher : IDispatcher
|
||||
{
|
||||
_mainThreadId = Environment.CurrentManagedThreadId;
|
||||
_mainDispatcher = new LinuxDispatcher();
|
||||
Console.WriteLine($"[LinuxDispatcher] Initialized on thread {_mainThreadId}");
|
||||
DiagnosticLog.Debug("LinuxDispatcher", $"Initialized on thread {_mainThreadId}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +45,7 @@ public class LinuxDispatcher : IDispatcher
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("[LinuxDispatcher] Error in dispatched action: " + ex.Message);
|
||||
DiagnosticLog.Error("LinuxDispatcher", "Error in dispatched action", ex);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
@@ -62,7 +63,7 @@ public class LinuxDispatcher : IDispatcher
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("[LinuxDispatcher] Error in delayed action: " + ex.Message);
|
||||
DiagnosticLog.Error("LinuxDispatcher", "Error in delayed action", ex);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using Microsoft.Maui.Dispatching;
|
||||
using Microsoft.Maui.Platform.Linux.Native;
|
||||
using Microsoft.Maui.Platform.Linux.Services;
|
||||
|
||||
namespace Microsoft.Maui.Platform.Linux.Dispatching;
|
||||
|
||||
@@ -95,7 +96,7 @@ public class LinuxDispatcherTimer : IDispatcherTimer
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("[LinuxDispatcherTimer] Error in Tick handler: " + ex.Message);
|
||||
DiagnosticLog.Error("LinuxDispatcherTimer", "Error in Tick handler", ex);
|
||||
}
|
||||
if (_isRepeating && _isRunning)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user