Skip to content

Commit

Permalink
Update Defaults+iCloud.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Mar 28, 2024
1 parent face2d9 commit a7e60de
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions Sources/Defaults/Defaults+iCloud.swift
Original file line number Diff line number Diff line change
Expand Up @@ -392,15 +392,14 @@ extension Defaults.iCloudSynchronizer {
return
}

var destination: String
switch source {
let destination = switch source {
case .local:
destination = "from local"
"from local"
case .remote:
destination = "from remote"
"from remote"
}

var status: String
let status: String
var valueDescription = " "
switch syncStatus {
case .idle:
Expand All @@ -424,9 +423,9 @@ extension Defaults.iCloudSynchronizer {
if #available(macOS 11, iOS 14, tvOS 14, watchOS 7, *) {
logger.debug("[Defaults.iCloud] \(message)")
} else {
#if canImport(OSLog)
#if canImport(OSLog)
os_log(.debug, log: .default, "[Defaults.iCloud] %@", message)
#else
#else
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss.SSSSSSZZZ"
let dateString = dateFormatter.string(from: Date())
Expand All @@ -435,7 +434,7 @@ extension Defaults.iCloudSynchronizer {
var threadID: UInt64 = 0
pthread_threadid_np(nil, &threadID)
print("\(dateString) \(processName)[\(processIdentifier):\(threadID)] [Defaults.iCloud] \(message)")
#endif
#endif
}
}
}
Expand Down

0 comments on commit a7e60de

Please sign in to comment.