From 854b11e477734d85f9ac65ad3ce012ad9e47b01f Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Tue, 14 Mar 2023 21:07:16 +0100 Subject: [PATCH] Use Logger materialisedFileHandling for logging in FileProviderMaterialisedEnumerationObserver Signed-off-by: Claudio Cambra --- .../FileProviderMaterialisedEnumerationObserver.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderMaterialisedEnumerationObserver.swift b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderMaterialisedEnumerationObserver.swift index 4bda429f1..a6325f3e9 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderMaterialisedEnumerationObserver.swift +++ b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderMaterialisedEnumerationObserver.swift @@ -14,6 +14,7 @@ import Foundation import FileProvider +import OSLog class FileProviderMaterialisedEnumerationObserver : NSObject, NSFileProviderEnumerationObserver { let ncKitAccount: String @@ -35,14 +36,14 @@ class FileProviderMaterialisedEnumerationObserver : NSObject, NSFileProviderEnum } func finishEnumerating(upTo nextPage: NSFileProviderPage?) { - NSLog("Handling enumerated materialised items.") + Logger.materialisedFileHandling.debug("Handling enumerated materialised items.") FileProviderMaterialisedEnumerationObserver.handleEnumeratedItems(self.allEnumeratedItemIds, account: self.ncKitAccount, completionHandler: self.completionHandler) } func finishEnumeratingWithError(_ error: Error) { - NSLog("Ran into error when enumerating materialised items. Handling items enumerated so far") + Logger.materialisedFileHandling.error("Ran into error when enumerating materialised items: \(error). Handling items enumerated so far") FileProviderMaterialisedEnumerationObserver.handleEnumeratedItems(self.allEnumeratedItemIds, account: self.ncKitAccount, completionHandler: self.completionHandler) @@ -64,7 +65,7 @@ class FileProviderMaterialisedEnumerationObserver : NSObject, NSFileProviderEnum } DispatchQueue.main.async { - NSLog("Cleaning up local file metadatas for unmaterialised items") + Logger.materialisedFileHandling.info("Cleaning up local file metadatas for unmaterialised items") for itemId in noLongerMaterialisedIds { dbManager.deleteLocalFileMetadata(ocId: itemId) }