From 85e8ad99a05a11f84f4dfabcf5159505844db965 Mon Sep 17 00:00:00 2001 From: "waffle.lord" Date: Mon, 25 Mar 2024 14:40:29 -0400 Subject: [PATCH] add logging to move patcher command --- .../Dialogs/WhyCacheThoughDialog.axaml.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/SPTInstaller/CustomControls/Dialogs/WhyCacheThoughDialog.axaml.cs b/SPTInstaller/CustomControls/Dialogs/WhyCacheThoughDialog.axaml.cs index 5e1d86b..4bc46f0 100644 --- a/SPTInstaller/CustomControls/Dialogs/WhyCacheThoughDialog.axaml.cs +++ b/SPTInstaller/CustomControls/Dialogs/WhyCacheThoughDialog.axaml.cs @@ -63,7 +63,9 @@ public partial class WhyCacheThoughDialog : UserControl if (!downloadsFolder.Exists) { - AdditionalInfo = "Could not get downloads folder :("; + var message = "Could not get downloads folder :("; + Log.Error($"[MV_0] {message}"); + AdditionalInfo = message; AdditionalInfoColor = "red"; _movePatcherState = -1; return; @@ -73,13 +75,15 @@ public partial class WhyCacheThoughDialog : UserControl if (_foundPatcher == null || !_foundPatcher.Exists) { - AdditionalInfo = - "Could not find a patcher file in your downloads folder"; + var message = "Could not find a patcher file in your downloads folder"; + Log.Warning($"[MV_0] {message}"); + AdditionalInfo = message; AdditionalInfoColor = "red"; return; } + Log.Information($"[MV_0] Found patcher for move: {_foundPatcher.Name}"); AdditionalInfo = $"Click again to move the below patcher file to the cache folder\n{_foundPatcher?.Name ?? "-SOMETHING WENT WRONG-"}"; AdditionalInfoColor = "#FFC107"; _movePatcherState = 1; @@ -89,7 +93,9 @@ public partial class WhyCacheThoughDialog : UserControl { var cacheFilePath = Path.Join(DownloadCacheHelper.CachePath, "patcher"); _foundPatcher?.MoveTo(cacheFilePath, true); - AdditionalInfo = "Patch was moved into cache :D"; + var message = "Patcher was moved into cache :D"; + Log.Information($"[MV_1] {message}"); + AdditionalInfo = message; AdditionalInfoColor = "ForestGreen"; } catch (Exception ex) @@ -99,6 +105,9 @@ public partial class WhyCacheThoughDialog : UserControl Log.Error(ex, "Failed to move downloaded patcher file into cache"); } break; + default: + Log.Error("[MV_ ] Move state is broken :("); + break; } } }