@@ -7,6 +7,7 @@ Imports CommunityToolkit.Mvvm.Input
77Imports CommunityToolkit.Mvvm.Messaging
88
99Imports CompactGUI.Core.SharedMethods
10+ Imports CompactGUI.Logging
1011
1112Imports Microsoft.Extensions.Logging
1213
@@ -97,11 +98,14 @@ Partial Public Class HomeViewModel : Inherits ObservableObject : Implements IRec
9798
9899 Public Async Function AddFoldersAsync(folderPaths As IEnumerable( Of String )) As Task
99100
101+ HomeViewModelLog.AddingFolders(_logger, folderPaths)
102+
100103 Dim invalidFolders = GetInvalidFolders(folderPaths.ToArray)
101104 Dim validFolders = folderPaths.Except(invalidFolders.InvalidFolders)
102105
103106 If invalidFolders.InvalidFolders.Count > 0 Then
104-
107+ 'TODO: Move this logger check to the snackbarService class?
108+ HomeViewModelLog.InvalidFolders(_logger, invalidFolders.InvalidFolders, invalidFolders.InvalidMessages.Select( Function (x) GetFolderVerificationMessage(x)))
105109 _snackbarService.ShowInvalidFoldersMessage(invalidFolders.InvalidFolders, invalidFolders.InvalidMessages)
106110 End If
107111
@@ -124,6 +128,7 @@ Partial Public Class HomeViewModel : Inherits ObservableObject : Implements IRec
124128 Await CType (newFolder, SteamFolder).GetWikiResults()
125129 Else
126130 If SettingsHandler.AppSettings.EstimateCompressionForNonSteamFolders Then
131+ HomeViewModelLog.GettingEstimatedCompression(_logger, newFolder.FolderName, newFolder.UncompressedBytes)
127132 Await newFolder.GetEstimatedCompression()
128133 End If
129134
@@ -205,10 +210,11 @@ Partial Public Class HomeViewModel : Inherits ObservableObject : Implements IRec
205210 Core.SharedMethods.PreventSleep()
206211 Dim tasks As New List( Of Task)()
207212 Dim foldersToCompress = Folders.Where( Function (f) f.FolderActionState = ActionState.Idle).ToList
213+ HomeViewModelLog.StartingBatchCompression(_logger, foldersToCompress.Count)
208214 For Each folder In foldersToCompress
209215 If folder.FolderActionState = ActionState.Idle Then
210216 Await Task.Run( Async Function ()
211- System.Diagnostics.Debug.WriteLine( "Compressing " & folder.FolderName)
217+ HomeViewModelLog.CompressingFolder(_logger, folder.FolderName)
212218 Dim ret = Await folder.CompressFolder()
213219 Dim analysis = Await folder.AnalyseFolderAsync
214220
@@ -241,7 +247,7 @@ Partial Public Class HomeViewModel : Inherits ObservableObject : Implements IRec
241247
242248
243249 Public Sub AddOrUpdateFolderWatcher(folder As CompressableFolder)
244- System.Diagnostics.Debug.WriteLine( "Adding folder to watcher: " & folder.FolderName)
250+ HomeViewModelLog.AddingFolderToWatcher(_logger, folder.FolderName)
245251
246252 Dim newWatched = New Watcher.WatchedFolder
247253 newWatched.Folder = folder.FolderName
0 commit comments