Skip to content

Free, open-source Windows optimization tool for performance, privacy, and simplicity.

Add logging to UpdateService and refine Disk logging

itsfatduckf31f4f1b7a8e
diff --git a/optimizerDuck/src/Core/Services/SystemInfoService.cs b/optimizerDuck/src/Core/Services/SystemInfoService.cs
index 7435792..9c21d04 100644
--- a/optimizerDuck/src/Core/Services/SystemInfoService.cs
+++ b/optimizerDuck/src/Core/Services/SystemInfoService.cs
@@ -743,7 +743,7 @@ public static class SystemInfoService
foreach (var volume in Snapshot.Disk.Volumes)
{
var systemDrive = volume.SystemDrive ? " [System Drive]" : "";
- log.LogDebug("Disk {VolumeName}{SystemDrive} ({VolumeDriveType}) [{VolumeTotalSizeGb:F1} GB] (Free: {VolumeFreeSpaceGb:F1} GB)",
+ log.LogDebug("Disk {VolumeName}{SystemDrive} [{VolumeDriveType}] {VolumeTotalSizeGb:F1} GB (Free: {VolumeFreeSpaceGb:F1} GB)",
volume.Name, systemDrive, volume.DriveTypeDescription, volume.TotalSizeGB, volume.FreeSpaceGB);
}
}
diff --git a/optimizerDuck/src/Core/Services/UpdateService.cs b/optimizerDuck/src/Core/Services/UpdateService.cs
index 951bd31..af91d27 100644
--- a/optimizerDuck/src/Core/Services/UpdateService.cs
+++ b/optimizerDuck/src/Core/Services/UpdateService.cs
@@ -1,6 +1,3 @@
-using System.Diagnostics;
-using System.Net.Http.Headers;
-using System.Reflection;
using ConsoleInk;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
@@ -10,6 +7,9 @@ using optimizerDuck.UI;
using optimizerDuck.UI.Components;
using optimizerDuck.UI.Logger;
using Spectre.Console;
+using System.Diagnostics;
+using System.Net.Http.Headers;
+using System.Reflection;
namespace optimizerDuck.Core.Services;
@@ -50,6 +50,8 @@ public class UpdateService
if (preReleaseSeparatorIndex != -1)
latestVersionStr = latestVersionStr[..preReleaseSeparatorIndex];
+ Log.LogDebug("Latest release version: {LatestReleaseTagName}", latestRelease.TagName);
+
// Parse version
if (!Version.TryParse(latestVersionStr, out var latestVersion))
{
@@ -148,7 +150,7 @@ public class UpdateService
private static void LaunchUpdater(string newExePath)
{
- SystemHelper.Title("Updating Application");
+ SystemHelper.Title("Updating Application");
Log.LogInformation("Starting update...");
var currentProcess = Process.GetCurrentProcess();
Log.LogDebug("Current process ID: {Pid}", currentProcess.Id);