Skip to content

Commit a775cdd

Browse files
committed
fix: Added missing log formatting support for Date and URL.
Signed-off-by: Iva Horn <iva.horn@nextcloud.com>
1 parent 9d3a90e commit a775cdd

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

Sources/NextcloudFileProviderKit/Log/FileProviderLog.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ public actor FileProviderLog: FileProviderLogging {
226226
switch value {
227227
case let account as Account:
228228
valueDescription = account.ncKitAccount
229+
case let date as Date:
230+
valueDescription = messageDateFormatter.string(from: date)
229231
case let lock as NKLock:
230232
valueDescription = lock.token
231233
case let item as NSFileProviderItem:

Sources/NextcloudFileProviderKit/Log/FileProviderLogDetail.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ public enum FileProviderLogDetail: Encodable {
9090
if let someValue = anyOptional {
9191
if someValue.self is String {
9292
self = .string(someValue as! String)
93+
} else if let date = someValue as? Date {
94+
self = .date(date)
95+
} else if let url = someValue as? URL {
96+
self = .string(url.absoluteString)
9397
} else if let account = someValue as? Account {
9498
self = .string(account.ncKitAccount)
9599
} else if let error = someValue as? NSFileProviderError {

0 commit comments

Comments
 (0)