mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
shell_integration/macOS/FileProviderUIExt: Log eviction process
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
0da4edefc5
commit
66ea9276ad
@ -7,20 +7,30 @@
|
||||
|
||||
import FileProvider
|
||||
import Foundation
|
||||
import OSLog
|
||||
|
||||
func evict(
|
||||
itemsWithIdentifiers identifiers: [NSFileProviderItemIdentifier],
|
||||
inDomain domain: NSFileProviderDomain
|
||||
) async {
|
||||
Logger.eviction.debug("Starting eviction process…")
|
||||
guard let manager = NSFileProviderManager(for: domain) else {
|
||||
Logger.eviction.error(
|
||||
"Could not get manager for domain: \(domain.identifier.rawValue, privacy: .public)"
|
||||
)
|
||||
return;
|
||||
}
|
||||
do {
|
||||
for itemIdentifier in identifiers {
|
||||
Logger.eviction.error(
|
||||
"Evicting item: \(itemIdentifier.rawValue, privacy: .public)"
|
||||
)
|
||||
try await manager.evictItem(identifier: itemIdentifier)
|
||||
}
|
||||
} catch let error {
|
||||
|
||||
Logger.eviction.error(
|
||||
"Error evicting item: \(error.localizedDescription, privacy: .public)"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -11,6 +11,7 @@ extension Logger {
|
||||
private static var subsystem = Bundle.main.bundleIdentifier!
|
||||
|
||||
static let actionViewController = Logger(subsystem: subsystem, category: "actionViewController")
|
||||
static let eviction = Logger(subsystem: subsystem, category: "eviction")
|
||||
static let lockViewController = Logger(subsystem: subsystem, category: "lockViewController")
|
||||
static let metadataProvider = Logger(subsystem: subsystem, category: "metadataProvider")
|
||||
static let shareCapabilities = Logger(subsystem: subsystem, category: "shareCapabilities")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user