From bf8067371ff3101ad01a13137c74050943bf4e1e Mon Sep 17 00:00:00 2001 From: Dan Cunningham Date: Sun, 7 Jul 2024 09:38:20 -0700 Subject: [PATCH] This replaces os_log "%{PUBLIC}" with "%{public}", updates the project to version 3.0.0 Signed-off-by: Dan Cunningham --- NotificationService/NotificationService.swift | 28 +++++++-------- .../Model/OpenHABSitemapPage.swift | 2 +- .../Util/ClientCertificateManager.swift | 14 ++++---- .../Sources/OpenHABCore/Util/Endpoint.swift | 2 +- .../Sources/OpenHABCore/Util/HTTPClient.swift | 6 ++-- .../OpenHABCore/Util/NetworkConnection.swift | 16 ++++----- .../OpenHABCore/Util/OpenHABItemCache.swift | 18 +++++----- .../OpenHABCore/Util/OpenHABLogger.swift | 4 +-- openHAB.xcodeproj/project.pbxproj | 26 +++++++------- openHAB/AppDelegate.swift | 34 +++++++++---------- openHAB/NewImageUITableViewCell.swift | 4 +-- .../OpenHABDrawerTableViewController.swift | 18 +++++----- .../OpenHABNotificationsViewController.swift | 4 +-- openHAB/OpenHABRootViewController.swift | 10 +++--- openHAB/OpenHABSitemapViewController.swift | 28 +++++++-------- openHAB/OpenHABTracker.swift | 16 ++++----- openHAB/OpenHABWebViewController.swift | 32 ++++++++--------- openHAB/VideoUITableViewCell.swift | 4 +-- openHAB/WatchMessageService.swift | 6 ++-- openHAB/WebUITableViewCell.swift | 12 +++---- .../GetItemStateIntentHandler.swift | 2 +- .../SetColorValueIntentHandler.swift | 2 +- .../SetContactStateValueIntentHandler.swift | 2 +- .../SetDimmerRollerValueIntentHandler.swift | 2 +- .../SetNumberValueIntentHandler.swift | 2 +- .../SetStringValueIntentHandler.swift | 2 +- .../SetSwitchStateIntentHandler.swift | 2 +- .../OpenHABWatchTracker.swift | 8 ++--- .../Views/Rows/ImageRow.swift | 4 +-- .../Views/Utils/IconView.swift | 4 +-- .../Model/ObservableOpenHABSitemapPage.swift | 2 +- .../ObservableOpenHABWidgetExtension.swift | 2 +- .../openHABWatch Extension/UserData.swift | 16 ++++----- .../external/AppMessageService.swift | 14 ++++---- 34 files changed, 174 insertions(+), 174 deletions(-) diff --git a/NotificationService/NotificationService.swift b/NotificationService/NotificationService.swift index 7e2932b7..f516de5b 100644 --- a/NotificationService/NotificationService.swift +++ b/NotificationService/NotificationService.swift @@ -26,7 +26,7 @@ class NotificationService: UNNotificationServiceExtension { var notificationActions: [UNNotificationAction] = [] let userInfo = bestAttemptContent.userInfo - os_log("didReceive userInfo %{PUBLIC}@", log: .default, type: .info, userInfo) + os_log("didReceive userInfo %{public}@", log: .default, type: .info, userInfo) if let title = userInfo["title"] as? String { bestAttemptContent.title = title @@ -54,7 +54,7 @@ class NotificationService: UNNotificationServiceExtension { } } if !notificationActions.isEmpty { - os_log("didReceive registering %{PUBLIC}@ for category %{PUBLIC}@", log: .default, type: .info, notificationActions, category) + os_log("didReceive registering %{public}@ for category %{public}@", log: .default, type: .info, notificationActions, category) let notificationCategory = UNNotificationCategory( identifier: category, @@ -67,7 +67,7 @@ class NotificationService: UNNotificationServiceExtension { let existingCategoryIdentifiers = existingCategories.map(\.identifier) if !existingCategoryIdentifiers.contains(category) { var updatedCategories = existingCategories - os_log("handleNotification adding category %{PUBLIC}@", log: .default, type: .info, category) + os_log("handleNotification adding category %{public}@", log: .default, type: .info, category) updatedCategories.insert(notificationCategory) UNUserNotificationCenter.current().setNotificationCategories(updatedCategories) } @@ -86,13 +86,13 @@ class NotificationService: UNNotificationServiceExtension { } else { downloadAndAttachMedia } - os_log("handleNotification downloading %{PUBLIC}@", log: .default, type: .info, attachmentURLString) + os_log("handleNotification downloading %{public}@", log: .default, type: .info, attachmentURLString) downloadHandler(attachmentURL) { attachment in if let attachment { - os_log("handleNotification attaching %{PUBLIC}@", log: .default, type: .info, attachmentURLString) + os_log("handleNotification attaching %{public}@", log: .default, type: .info, attachmentURLString) bestAttemptContent.attachments = [attachment] } else { - os_log("handleNotification could not attach %{PUBLIC}@", log: .default, type: .info, attachmentURLString) + os_log("handleNotification could not attach %{public}@", log: .default, type: .info, attachmentURLString) } contentHandler(bestAttemptContent) } @@ -122,7 +122,7 @@ class NotificationService: UNNotificationServiceExtension { return actionsArray } } catch { - os_log("Error parsing actions: %{PUBLIC}@", log: .default, type: .info, error.localizedDescription) + os_log("Error parsing actions: %{public}@", log: .default, type: .info, error.localizedDescription) } } return nil @@ -141,7 +141,7 @@ class NotificationService: UNNotificationServiceExtension { let client = HTTPClient(username: Preferences.username, password: Preferences.username) // lets not always send auth with this client.downloadFile(url: url) { localURL, response, error in guard let localURL else { - os_log("Error downloading media %{PUBLIC}@", log: .default, type: .error, error?.localizedDescription ?? "Unknown error") + os_log("Error downloading media %{public}@", log: .default, type: .error, error?.localizedDescription ?? "Unknown error") completion(nil) return } @@ -151,7 +151,7 @@ class NotificationService: UNNotificationServiceExtension { func downloadAndAttachItemImage(attachmentURL: URL, completion: @escaping (UNNotificationAttachment?) -> Void) { guard let scheme = attachmentURL.scheme else { - os_log("Could not find scheme %{PUBLIC}@", log: .default, type: .info) + os_log("Could not find scheme %{public}@", log: .default, type: .info) completion(nil) return } @@ -161,7 +161,7 @@ class NotificationService: UNNotificationServiceExtension { let client = HTTPClient(username: Preferences.username, password: Preferences.username, alwaysSendBasicAuth: Preferences.alwaysSendCreds) client.getItem(baseURLs: [Preferences.localUrl, Preferences.remoteUrl], itemName: itemName) { item, error in guard let item else { - os_log("Could not find item %{PUBLIC}@", log: .default, type: .info, itemName) + os_log("Could not find item %{public}@", log: .default, type: .info, itemName) completion(nil) return } @@ -182,11 +182,11 @@ class NotificationService: UNNotificationServiceExtension { let tempFileURL = tempDirectory.appendingPathComponent(UUID().uuidString) do { try imageData.write(to: tempFileURL) - os_log("Image saved to temporary file: %{PUBLIC}@", log: .default, type: .info, tempFileURL.absoluteString) + os_log("Image saved to temporary file: %{public}@", log: .default, type: .info, tempFileURL.absoluteString) self.attachFile(localURL: tempFileURL, mimeType: mimeType, completion: completion) return } catch { - os_log("Failed to write image data to file: %{PUBLIC}@", log: .default, type: .error, error.localizedDescription) + os_log("Failed to write image data to file: %{public}@", log: .default, type: .error, error.localizedDescription) } } else { os_log("Failed to decode base64 string to Data", log: .default, type: .error) @@ -194,7 +194,7 @@ class NotificationService: UNNotificationServiceExtension { } } } catch { - os_log("Failed to parse data: %{PUBLIC}@", log: .default, type: .error, error.localizedDescription) + os_log("Failed to parse data: %{public}@", log: .default, type: .error, error.localizedDescription) } } completion(nil) @@ -223,7 +223,7 @@ class NotificationService: UNNotificationServiceExtension { completion(attachment) return } catch { - os_log("Failed to create UNNotificationAttachment: %{PUBLIC}@", log: .default, type: .error, error.localizedDescription) + os_log("Failed to create UNNotificationAttachment: %{public}@", log: .default, type: .error, error.localizedDescription) } completion(nil) } diff --git a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABSitemapPage.swift b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABSitemapPage.swift index 03f1b26d..6518d82c 100644 --- a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABSitemapPage.swift +++ b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABSitemapPage.swift @@ -65,7 +65,7 @@ public class OpenHABSitemapPage: NSObject { private func sendCommand(_ item: OpenHABItem?, commandToSend command: String?) { guard let item else { return } - os_log("SitemapPage sending command %{PUBLIC}@ to %{PUBLIC}@", log: OSLog.remoteAccess, type: .info, command.orEmpty, item.name) + os_log("SitemapPage sending command %{public}@ to %{public}@", log: OSLog.remoteAccess, type: .info, command.orEmpty, item.name) sendCommand?(item, command) } } diff --git a/OpenHABCore/Sources/OpenHABCore/Util/ClientCertificateManager.swift b/OpenHABCore/Sources/OpenHABCore/Util/ClientCertificateManager.swift index 11138ef1..ba4340c6 100644 --- a/OpenHABCore/Sources/OpenHABCore/Util/ClientCertificateManager.swift +++ b/OpenHABCore/Sources/OpenHABCore/Util/ClientCertificateManager.swift @@ -98,14 +98,14 @@ public class ClientCertificateManager { kSecValueRef as String: cert! ] var status = SecItemDelete(deleteCertQuery as NSDictionary) - os_log("SecItemDelete(cert) result=%{PUBLIC}d", log: .default, type: .info, status) + os_log("SecItemDelete(cert) result=%{public}d", log: .default, type: .info, status) if status == noErr { let deleteKeyQuery: [String: Any] = [ kSecClass as String: kSecClassKey, kSecValueRef as String: key! ] status = SecItemDelete(deleteKeyQuery as NSDictionary) - os_log("SecItemDelete(key) result=%{PUBLIC}d", log: .default, type: .info, status) + os_log("SecItemDelete(key) result=%{public}d", log: .default, type: .info, status) } // Figure out which certs in the certificate chain also need to be removed. @@ -124,7 +124,7 @@ public class ClientCertificateManager { ] let status = SecItemDelete(deleteCertQuery as NSDictionary) let summary = SecCertificateCopySubjectSummary(ct) as String? ?? "" - os_log("SecItemDelete(certChain) %s result=%{PUBLIC}d", log: .default, type: .info, summary, status) + os_log("SecItemDelete(certChain) %s result=%{public}d", log: .default, type: .info, summary, status) } } } @@ -198,7 +198,7 @@ public class ClientCertificateManager { kSecValueRef as String: clientCert! ] var status = SecItemAdd(addCertQuery as NSDictionary, nil) - os_log("SecItemAdd(cert) result=%{PUBLIC}d", log: .default, type: .info, status) + os_log("SecItemAdd(cert) result=%{public}d", log: .default, type: .info, status) if status == noErr { let addKeyQuery: [String: Any] = [ kSecClass as String: kSecClassKey, @@ -206,7 +206,7 @@ public class ClientCertificateManager { kSecValueRef as String: clientKey! ] status = SecItemAdd(addKeyQuery as NSDictionary, nil) - os_log("SecItemAdd(key) result=%{PUBLIC}d", log: .default, type: .info, status) + os_log("SecItemAdd(key) result=%{public}d", log: .default, type: .info, status) // Add the cert chain if let importingCertChain { @@ -216,7 +216,7 @@ public class ClientCertificateManager { kSecValueRef as String: cert ] status = SecItemAdd(addCertQuery as NSDictionary, nil) - os_log("SecItemAdd(certChain) result=%{PUBLIC}d", log: .default, type: .info, status) + os_log("SecItemAdd(certChain) result=%{public}d", log: .default, type: .info, status) if status == errSecDuplicateItem { // Ignore duplicates as there may already be other client certs with an overlapping issuer chain status = noErr @@ -251,7 +251,7 @@ public class ClientCertificateManager { importingIdentity = identityDictionaries[0][kSecImportItemIdentity as String] as! SecIdentity? importingCertChain = identityDictionaries[0][kSecImportItemCertChain as String] as! [SecCertificate]? } else { - os_log("SecPKCS12Import failed; result=%{PUBLIC}d", log: .default, type: .info, status) + os_log("SecPKCS12Import failed; result=%{public}d", log: .default, type: .info, status) } return status } diff --git a/OpenHABCore/Sources/OpenHABCore/Util/Endpoint.swift b/OpenHABCore/Sources/OpenHABCore/Util/Endpoint.swift index cf63b0b3..3602e026 100644 --- a/OpenHABCore/Sources/OpenHABCore/Util/Endpoint.swift +++ b/OpenHABCore/Sources/OpenHABCore/Util/Endpoint.swift @@ -38,7 +38,7 @@ public extension Endpoint { var components = URLComponents(string: baseURL) components?.path = path components?.queryItems = queryItems - os_log("URL: %{PUBLIC}@", log: OSLog.urlComposition, type: .debug, components?.url?.absoluteString ?? "") + os_log("URL: %{public}@", log: OSLog.urlComposition, type: .debug, components?.url?.absoluteString ?? "") return components?.url } diff --git a/OpenHABCore/Sources/OpenHABCore/Util/HTTPClient.swift b/OpenHABCore/Sources/OpenHABCore/Util/HTTPClient.swift index 0a1d49dc..9d14b519 100644 --- a/OpenHABCore/Sources/OpenHABCore/Util/HTTPClient.swift +++ b/OpenHABCore/Sources/OpenHABCore/Util/HTTPClient.swift @@ -89,11 +89,11 @@ public class HTTPClient: NSObject, URLSessionDelegate { for codingDatum in codingDatas where codingDatum.openHABItem.type != OpenHABItem.ItemType.group { items.append(codingDatum.openHABItem) } - os_log("Loaded items to cache: %{PUBLIC}d", log: .networking, type: .info, items.count) + os_log("Loaded items to cache: %{public}d", log: .networking, type: .info, items.count) } completion(items, nil) } catch { - os_log("getItemsInternal ERROR: %{PUBLIC}@", log: .networking, type: .info, String(describing: error)) + os_log("getItemsInternal ERROR: %{public}@", log: .networking, type: .info, String(describing: error)) completion(nil, error) } } @@ -116,7 +116,7 @@ public class HTTPClient: NSObject, URLSessionDelegate { completion(nil, NSError(domain: "HTTPClient", code: -1, userInfo: [NSLocalizedDescriptionKey: "No data for item"])) } } catch { - os_log("getItemsInternal ERROR: %{PUBLIC}@", log: .networking, type: .info, String(describing: error)) + os_log("getItemsInternal ERROR: %{public}@", log: .networking, type: .info, String(describing: error)) completion(nil, error) } } diff --git a/OpenHABCore/Sources/OpenHABCore/Util/NetworkConnection.swift b/OpenHABCore/Sources/OpenHABCore/Util/NetworkConnection.swift index 51072269..1d7e4438 100644 --- a/OpenHABCore/Sources/OpenHABCore/Util/NetworkConnection.swift +++ b/OpenHABCore/Sources/OpenHABCore/Util/NetworkConnection.swift @@ -14,7 +14,7 @@ import Foundation import os.log public func onReceiveSessionTaskChallenge(with challenge: URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?) { - os_log("onReceiveSessionTaskChallenge host:'%{PUBLIC}@'", log: .default, type: .error, challenge.protectionSpace.host) + os_log("onReceiveSessionTaskChallenge host:'%{public}@'", log: .default, type: .error, challenge.protectionSpace.host) var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling var credential: URLCredential? @@ -26,14 +26,14 @@ public func onReceiveSessionTaskChallenge(with challenge: URLAuthenticationChall if challenge.protectionSpace.host == localUrl?.host || challenge.protectionSpace.host == remoteUrl?.host || challenge.protectionSpace.host == "home.myopenhab.org" { credential = URLCredential(user: Preferences.username, password: Preferences.password, persistence: .forSession) disposition = .useCredential - os_log("HTTP BasicAuth host:'%{PUBLIC}@'", log: .default, type: .error, challenge.protectionSpace.host) + os_log("HTTP BasicAuth host:'%{public}@'", log: .default, type: .error, challenge.protectionSpace.host) } } return (disposition, credential) } public func onReceiveSessionChallenge(with challenge: URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?) { - os_log("onReceiveSessionChallenge host:'%{PUBLIC}@'", log: .default, type: .error, challenge.protectionSpace.host) + os_log("onReceiveSessionChallenge host:'%{public}@'", log: .default, type: .error, challenge.protectionSpace.host) var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling var credential: URLCredential? @@ -154,10 +154,10 @@ public class NetworkConnection { commandRequest.setValue("text/plain", forHTTPHeaderField: "Content-type") - os_log("Timeout %{PUBLIC}g", log: .default, type: .info, commandRequest.timeoutInterval) + os_log("Timeout %{public}g", log: .default, type: .info, commandRequest.timeoutInterval) let link = item.link - os_log("OpenHABViewController posting %{PUBLIC}@ command to %{PUBLIC}@", log: .default, type: .info, command ?? "", link) - os_log("%{PUBLIC}@", log: .default, type: .info, commandRequest.debugDescription) + os_log("OpenHABViewController posting %{public}@ command to %{public}@", log: .default, type: .info, command ?? "", link) + os_log("%{public}@", log: .default, type: .info, commandRequest.debugDescription) return NetworkConnection.shared.manager.request(commandRequest) .validate() @@ -166,7 +166,7 @@ public class NetworkConnection { case .success: os_log("Command sent!", log: .remoteAccess, type: .info) case let .failure(error): - os_log("%{PUBLIC}@ %d", log: .default, type: .error, error.localizedDescription, response.response?.statusCode ?? 0) + os_log("%{public}@ %d", log: .default, type: .error, error.localizedDescription, response.response?.statusCode ?? 0) } } } @@ -211,7 +211,7 @@ public class NetworkConnection { if pageUrl == "" { return nil } - os_log("pageUrl = %{PUBLIC}@", log: OSLog.remoteAccess, type: .info, pageUrl) + os_log("pageUrl = %{public}@", log: OSLog.remoteAccess, type: .info, pageUrl) guard let pageToLoadUrl = URL(string: pageUrl) else { return nil } diff --git a/OpenHABCore/Sources/OpenHABCore/Util/OpenHABItemCache.swift b/OpenHABCore/Sources/OpenHABCore/Util/OpenHABItemCache.swift index ede1f291..2a9373a6 100644 --- a/OpenHABCore/Sources/OpenHABCore/Util/OpenHABItemCache.swift +++ b/OpenHABCore/Sources/OpenHABCore/Util/OpenHABItemCache.swift @@ -76,7 +76,7 @@ public class OpenHABItemCache { guard let uurl = getURL() else { return } - os_log("Loading items from %{PUBLIC}@", log: .default, type: .info, url) + os_log("Loading items from %{public}@", log: .default, type: .info, url) if NetworkConnection.shared == nil { NetworkConnection.initialize(ignoreSSL: Preferences.ignoreSSL, interceptor: nil) @@ -92,16 +92,16 @@ public class OpenHABItemCache { completion(ret) } catch { - os_log("%{PUBLIC}@ ", log: .default, type: .error, error.localizedDescription) + os_log("%{public}@ ", log: .default, type: .error, error.localizedDescription) } case let .failure(error): if self.lastUrlConnected == OpenHABItemCache.URL_LOCAL { self.localUrlFailed = true - os_log("%{PUBLIC}@ ", log: .default, type: .info, error.localizedDescription) + os_log("%{public}@ ", log: .default, type: .info, error.localizedDescription) self.reload(searchTerm: searchTerm, types: types, completion: completion) // try remote } else { - os_log("%{PUBLIC}@ ", log: .default, type: .error, error.localizedDescription) + os_log("%{public}@ ", log: .default, type: .error, error.localizedDescription) } } } @@ -113,7 +113,7 @@ public class OpenHABItemCache { guard let uurl = getURL() else { return } - os_log("Loading items from %{PUBLIC}@", log: .default, type: .info, url) + os_log("Loading items from %{public}@", log: .default, type: .info, url) if NetworkConnection.shared == nil { NetworkConnection.initialize(ignoreSSL: Preferences.ignoreSSL, interceptor: nil) @@ -130,16 +130,16 @@ public class OpenHABItemCache { completion(item) } catch { - os_log("%{PUBLIC}@ ", log: .default, type: .error, error.localizedDescription) + os_log("%{public}@ ", log: .default, type: .error, error.localizedDescription) } case let .failure(error): if self.lastUrlConnected == OpenHABItemCache.URL_LOCAL { self.localUrlFailed = true - os_log("%{PUBLIC}@ ", log: .default, type: .info, error.localizedDescription) + os_log("%{public}@ ", log: .default, type: .info, error.localizedDescription) self.reload(name: name, completion: completion) // try remote } else { - os_log("%{PUBLIC}@ ", log: .default, type: .error, error.localizedDescription) + os_log("%{public}@ ", log: .default, type: .error, error.localizedDescription) } } } @@ -180,6 +180,6 @@ public class OpenHABItemCache { self.items?.append(codingDatum.openHABItem) } - os_log("Loaded items to cache: %{PUBLIC}d", log: .default, type: .info, items?.count ?? 0) + os_log("Loaded items to cache: %{public}d", log: .default, type: .info, items?.count ?? 0) } } diff --git a/OpenHABCore/Sources/OpenHABCore/Util/OpenHABLogger.swift b/OpenHABCore/Sources/OpenHABCore/Util/OpenHABLogger.swift index 3f47e5b9..6495b502 100644 --- a/OpenHABCore/Sources/OpenHABCore/Util/OpenHABLogger.swift +++ b/OpenHABCore/Sources/OpenHABCore/Util/OpenHABLogger.swift @@ -18,11 +18,11 @@ final class OpenHABLogger: EventMonitor { // Event called when any type of Request is resumed. func requestDidResume(_ request: Request) { - os_log("Resuming: %{PUBLIC}@", log: .alamofire, type: .info, request.description) + os_log("Resuming: %{public}@", log: .alamofire, type: .info, request.description) } // Event called whenever a DataRequest has parsed a response. func request(_ request: DataRequest, didParseResponse response: DataResponse) { - os_log("Finished %{PUBLIC}@", log: .alamofire, type: .debug, response.error.debugDescription) + os_log("Finished %{public}@", log: .alamofire, type: .debug, response.error.debugDescription) } } diff --git a/openHAB.xcodeproj/project.pbxproj b/openHAB.xcodeproj/project.pbxproj index 70188299..a78fb835 100644 --- a/openHAB.xcodeproj/project.pbxproj +++ b/openHAB.xcodeproj/project.pbxproj @@ -1638,7 +1638,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 3.0.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = org.openhab.app.openHABIntents; @@ -1681,7 +1681,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 3.0.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = org.openhab.app.openHABIntents; @@ -1727,7 +1727,7 @@ "@executable_path/../../Frameworks", ); LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 3.0.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = org.openhab.app.NotificationService; @@ -1774,7 +1774,7 @@ "@executable_path/../../Frameworks", ); LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 3.0.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = org.openhab.app.NotificationService; @@ -1812,7 +1812,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 3.0.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = es.spaphone.openHABUITests; @@ -1858,7 +1858,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 3.0.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = es.spaphone.openHABUITests; @@ -1903,7 +1903,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 3.0.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = org.openhab.app.watchkitapp; @@ -1950,7 +1950,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 3.0.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = org.openhab.app.watchkitapp; @@ -1993,7 +1993,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 3.0.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.reg-labs.openHABTestsSwift"; @@ -2036,7 +2036,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 3.0.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.reg-labs.openHABTestsSwift"; @@ -2162,7 +2162,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 16.0; - MARKETING_VERSION = 2.2.56; + MARKETING_VERSION = 3.0.0; ONLY_ACTIVE_ARCH = NO; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; @@ -2199,7 +2199,7 @@ "@loader_path/../../Frameworks", ); LIBRARY_SEARCH_PATHS = "$(inherited)"; - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 3.0.0; OTHER_SWIFT_FLAGS = "$(inherited) -DDEBUG -Xfrontend -warn-long-expression-type-checking=200 -Xfrontend -warn-long-function-bodies=200"; PRODUCT_BUNDLE_IDENTIFIER = org.openhab.app; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2244,7 +2244,7 @@ "@loader_path/../../Frameworks", ); LIBRARY_SEARCH_PATHS = "$(inherited)"; - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 3.0.0; PRODUCT_BUNDLE_IDENTIFIER = org.openhab.app; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; diff --git a/openHAB/AppDelegate.swift b/openHAB/AppDelegate.swift index 9a040789..16ae79f0 100644 --- a/openHAB/AppDelegate.swift +++ b/openHAB/AppDelegate.swift @@ -36,7 +36,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD if let session { session.delegate = WatchMessageService.singleton session.activate() - os_log("Paired watch %{PUBLIC}@, watch app installed %{PUBLIC}@", log: .watch, type: .info, "\(session.isPaired)", "\(session.isWatchAppInstalled)") + os_log("Paired watch %{public}@, watch app installed %{public}@", log: .watch, type: .info, "\(session.isPaired)", "\(session.isWatchAppInstalled)") } } } @@ -64,8 +64,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD registerForPushNotifications() - os_log("uniq id: %{PUBLIC}s", log: .notifications, type: .info, UIDevice.current.identifierForVendor?.uuidString ?? "") - os_log("device name: %{PUBLIC}s", log: .notifications, type: .info, UIDevice.current.name) + os_log("uniq id: %{public}s", log: .notifications, type: .info, UIDevice.current.identifierForVendor?.uuidString ?? "") + os_log("device name: %{public}s", log: .notifications, type: .info, UIDevice.current.name) let audioSession = AVAudioSession.sharedInstance() do { @@ -113,10 +113,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { [weak self] granted, _ in guard let self else { return } - os_log("Permission granted: %{PUBLIC}@", log: .notifications, type: .info, granted ? "YES" : "NO") + os_log("Permission granted: %{public}@", log: .notifications, type: .info, granted ? "YES" : "NO") guard granted else { return } UNUserNotificationCenter.current().getNotificationSettings { settings in - os_log("Notification settings: %{PUBLIC}@", log: .notifications, type: .info, settings) + os_log("Notification settings: %{public}@", log: .notifications, type: .info, settings) guard settings.authorizationStatus == .authorized else { return } DispatchQueue.main.async { @@ -131,9 +131,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD // TODO: Pass this parameters to openHABViewController somehow to open specified sitemap/page and send specified command // Probably need to do this in a way compatible to Android app's URL - os_log("Calling Application Bundle ID: %{PUBLIC}@", log: .notifications, type: .info, options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String ?? "") - os_log("URL scheme: %{PUBLIC}@", log: .notifications, type: .info, url.scheme ?? "") - os_log("URL query: %{PUBLIC}@", log: .notifications, type: .info, url.query ?? "") + os_log("Calling Application Bundle ID: %{public}@", log: .notifications, type: .info, options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String ?? "") + os_log("URL scheme: %{public}@", log: .notifications, type: .info, url.scheme ?? "") + os_log("URL query: %{public}@", log: .notifications, type: .info, url.query ?? "") if url.isFileURL { let clientCertificateManager = NetworkConnection.shared.clientCertificateManager @@ -149,16 +149,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD } func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) { - os_log("Failed to get token for notifications: %{PUBLIC}@", log: .notifications, type: .error, error.localizedDescription) + os_log("Failed to get token for notifications: %{public}@", log: .notifications, type: .error, error.localizedDescription) } // this is called for "content-available" silent notifications (background notifications) func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { - os_log("didReceiveRemoteNotification %{PUBLIC}@", log: .default, type: .info, userInfo) + os_log("didReceiveRemoteNotification %{public}@", log: .default, type: .info, userInfo) // Hide notification logic if let type = userInfo["type"] as? String, type == "hideNotification" { if let refid = userInfo["reference-id"] as? String { - os_log("didReceiveRemoteNotification remove id %{PUBLIC}@", log: .default, type: .info, refid) + os_log("didReceiveRemoteNotification remove id %{public}@", log: .default, type: .info, refid) UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: [refid]) } if let tag = userInfo["tag"] as? String { @@ -171,7 +171,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD let identifiers = notificationsWithSeverity.map(\.request.identifier) if !identifiers.isEmpty { - os_log("didReceiveRemoteNotification remove tag %{PUBLIC}@ %{PUBLIC}@", log: .default, type: .info, tag, identifiers) + os_log("didReceiveRemoteNotification remove tag %{public}@ %{public}@", log: .default, type: .info, tag, identifiers) // Remove the filtered notifications UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: identifiers) } @@ -184,7 +184,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD // this is called when a notification comes in while in the foreground func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { let userInfo = notification.request.content.userInfo - os_log("Notification received while app is in foreground: %{PUBLIC}@", log: .notifications, type: .info, userInfo) + os_log("Notification received while app is in foreground: %{public}@", log: .notifications, type: .info, userInfo) appData.lastNotificationInfo = userInfo displayNotification(userInfo: userInfo) completionHandler([]) @@ -206,17 +206,17 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD } private func displayNotification(userInfo: [AnyHashable: Any]) { - os_log("displayNotification %{PUBLIC}@", log: .notifications, type: .info, userInfo["message"] as? String ?? "no message") + os_log("displayNotification %{public}@", log: .notifications, type: .info, userInfo["message"] as? String ?? "no message") let soundPath: URL? = Bundle.main.url(forResource: "ping", withExtension: "wav") if let soundPath { do { - os_log("Sound path %{PUBLIC}@", log: .notifications, type: .info, soundPath.debugDescription) + os_log("Sound path %{public}@", log: .notifications, type: .info, soundPath.debugDescription) player = try AVAudioPlayer(contentsOf: soundPath) player?.numberOfLoops = 0 player?.play() } catch { - os_log("%{PUBLIC}@", log: .notifications, type: .error, error.localizedDescription) + os_log("%{public}@", log: .notifications, type: .error, error.localizedDescription) } player = try? AVAudioPlayer(contentsOf: soundPath) } @@ -277,7 +277,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD extension AppDelegate: MessagingDelegate { func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) { - os_log("My FCM token is: %{PUBLIC}@", log: .notifications, type: .info, fcmToken ?? "") + os_log("My FCM token is: %{public}@", log: .notifications, type: .info, fcmToken ?? "") let dataDict = [ "deviceToken": fcmToken ?? "", "deviceId": UIDevice.current.identifierForVendor?.uuidString ?? "", diff --git a/openHAB/NewImageUITableViewCell.swift b/openHAB/NewImageUITableViewCell.swift index 482cbfc5..5c0ff731 100644 --- a/openHAB/NewImageUITableViewCell.swift +++ b/openHAB/NewImageUITableViewCell.swift @@ -149,7 +149,7 @@ class NewImageUITableViewCell: GenericUITableViewCell { } private func loadRemoteImage(withURL url: URL) { - os_log("Image URL: %{PUBLIC}@", log: OSLog.urlComposition, type: .debug, url.absoluteString) + os_log("Image URL: %{public}@", log: OSLog.urlComposition, type: .debug, url.absoluteString) var imageRequest = URLRequest(url: url) imageRequest.timeoutInterval = 10.0 @@ -173,7 +173,7 @@ class NewImageUITableViewCell: GenericUITableViewCell { self?.didLoad?() } case let .failure(error): - os_log("Download failed: %{PUBLIC}@", log: .urlComposition, type: .debug, error.localizedDescription) + os_log("Download failed: %{public}@", log: .urlComposition, type: .debug, error.localizedDescription) } } downloadRequest?.resume() diff --git a/openHAB/OpenHABDrawerTableViewController.swift b/openHAB/OpenHABDrawerTableViewController.swift index 2b5ceed5..e789cafb 100644 --- a/openHAB/OpenHABDrawerTableViewController.swift +++ b/openHAB/OpenHABDrawerTableViewController.swift @@ -24,12 +24,12 @@ func deriveSitemaps(_ response: Data?, version: Int?) -> [OpenHABSitemap] { os_log("openHAB 1", log: .viewCycle, type: .info) if let response { - os_log("%{PUBLIC}@", log: .remoteAccess, type: .info, String(data: response, encoding: .utf8) ?? "") + os_log("%{public}@", log: .remoteAccess, type: .info, String(data: response, encoding: .utf8) ?? "") } if let data = response, let doc = try? XMLDocument(data: data), let name = doc.root?.tag { - os_log("%{PUBLIC}@", log: .remoteAccess, type: .info, name) + os_log("%{public}@", log: .remoteAccess, type: .info, name) if name == "sitemaps" { for element in doc.root?.children(tag: "sitemap") ?? [] { let sitemap = OpenHABSitemap(xml: element) @@ -47,11 +47,11 @@ func deriveSitemaps(_ response: Data?, version: Int?) -> [OpenHABSitemap] { os_log("Response will be decoded by JSON", log: .remoteAccess, type: .info) let sitemapsCodingData = try response.decoded(as: [OpenHABSitemap.CodingData].self) for sitemapCodingDatum in sitemapsCodingData { - os_log("Sitemap %{PUBLIC}@", log: .remoteAccess, type: .info, sitemapCodingDatum.label) + os_log("Sitemap %{public}@", log: .remoteAccess, type: .info, sitemapCodingDatum.label) sitemaps.append(sitemapCodingDatum.openHABSitemap) } } catch { - os_log("Should not throw %{PUBLIC}@", log: .notifications, type: .error, error.localizedDescription) + os_log("Should not throw %{public}@", log: .notifications, type: .error, error.localizedDescription) } } } @@ -122,7 +122,7 @@ class OpenHABDrawerTableViewController: UITableViewController { self.setStandardDrawerItems() self.tableView.reloadData() case let .failure(error): - os_log("%{PUBLIC}@", log: .default, type: .error, error.localizedDescription) + os_log("%{public}@", log: .default, type: .error, error.localizedDescription) self.drawerItems.removeAll() self.setStandardDrawerItems() self.tableView.reloadData() @@ -142,11 +142,11 @@ class OpenHABDrawerTableViewController: UITableViewController { self.uiTiles = try JSONDecoder().decode([OpenHABUiTile].self, from: responseData) self.tableView.reloadData() } catch { - os_log("Error: did not receive data %{PUBLIC}@", log: OSLog.remoteAccess, type: .info, error.localizedDescription) + os_log("Error: did not receive data %{public}@", log: OSLog.remoteAccess, type: .info, error.localizedDescription) } case let .failure(error): UIApplication.shared.isNetworkActivityIndicatorVisible = false - os_log("%{PUBLIC}@", log: .default, type: .error, error.localizedDescription) + os_log("%{public}@", log: .default, type: .error, error.localizedDescription) } } } @@ -228,11 +228,11 @@ class OpenHABDrawerTableViewController: UITableViewController { imageView.image = UIImage(data: imageData) } // data;image/png;base64, case _ where passedURL.hasPrefix("http"): - os_log("Loading %{PUBLIC}@", log: .default, type: .info, String(describing: passedURL)) + os_log("Loading %{public}@", log: .default, type: .info, String(describing: passedURL)) imageView.kf.setImage(with: URL(string: passedURL), placeholder: UIImage(named: "openHABIcon")) default: if let builtURL = Endpoint.resource(openHABRootUrl: appData?.openHABRootUrl ?? "", path: passedURL.prepare()).url { - os_log("Loading %{PUBLIC}@", log: .default, type: .info, String(describing: builtURL)) + os_log("Loading %{public}@", log: .default, type: .info, String(describing: builtURL)) imageView.kf.setImage(with: builtURL, placeholder: UIImage(named: "openHABIcon")) } } diff --git a/openHAB/OpenHABNotificationsViewController.swift b/openHAB/OpenHABNotificationsViewController.swift index c78ecdca..37b687a1 100644 --- a/openHAB/OpenHABNotificationsViewController.swift +++ b/openHAB/OpenHABNotificationsViewController.swift @@ -58,14 +58,14 @@ class OpenHABNotificationsViewController: UITableViewController { self.notifications.add(codingDatum.openHABNotification) } } catch { - os_log("%{PUBLIC}@ ", log: .default, type: .error, error.localizedDescription) + os_log("%{public}@ ", log: .default, type: .error, error.localizedDescription) } self.refreshControl?.endRefreshing() self.tableView.reloadData() case let .failure(error): - os_log("%{PUBLIC}@", log: .default, type: .error, error.localizedDescription) + os_log("%{public}@", log: .default, type: .error, error.localizedDescription) self.refreshControl?.endRefreshing() } } diff --git a/openHAB/OpenHABRootViewController.swift b/openHAB/OpenHABRootViewController.swift index f390dc6b..d994f59f 100644 --- a/openHAB/OpenHABRootViewController.swift +++ b/openHAB/OpenHABRootViewController.swift @@ -171,13 +171,13 @@ class OpenHABRootViewController: UIViewController { let prefsURL = Preferences.remoteUrl if prefsURL.contains("openhab.org") { guard let deviceId = theData?["deviceId"] as? String, let deviceToken = theData?["deviceToken"] as? String, let deviceName = theData?["deviceName"] as? String else { return } - os_log("Registering notifications with %{PUBLIC}@", log: .notifications, type: .info, prefsURL) + os_log("Registering notifications with %{public}@", log: .notifications, type: .info, prefsURL) NetworkConnection.register(prefsURL: prefsURL, deviceToken: deviceToken, deviceId: deviceId, deviceName: deviceName) { response in switch response.result { case .success: os_log("my.openHAB registration sent", log: .notifications, type: .info) case let .failure(error): - os_log("my.openHAB registration failed %{PUBLIC}@ %d", log: .notifications, type: .error, error.localizedDescription, response.response?.statusCode ?? 0) + os_log("my.openHAB registration failed %{public}@ %d", log: .notifications, type: .error, error.localizedDescription, response.response?.statusCode ?? 0) } } } @@ -207,7 +207,7 @@ class OpenHABRootViewController: UIViewController { } private func uiCommandAction(_ command: String) { - os_log("navigateCommandAction: %{PUBLIC}@", log: .notifications, type: .info, command) + os_log("navigateCommandAction: %{public}@", log: .notifications, type: .info, command) let pattern = "^(/basicui/app\\?.*|/.*|.*)$" do { @@ -218,7 +218,7 @@ class OpenHABRootViewController: UIViewController { if let match = results.first { let pathRange = match.range(at: 1) let path = nsString.substring(with: pathRange) - os_log("navigateCommandAction path: %{PUBLIC}@", log: .notifications, type: .info, path) + os_log("navigateCommandAction path: %{public}@", log: .notifications, type: .info, path) if currentView != webViewController { switchView(target: .webview) } @@ -235,7 +235,7 @@ class OpenHABRootViewController: UIViewController { } } } catch { - os_log("Invalid regex: %{PUBLIC}@", log: .notifications, type: .error, error.localizedDescription) + os_log("Invalid regex: %{public}@", log: .notifications, type: .error, error.localizedDescription) } } diff --git a/openHAB/OpenHABSitemapViewController.swift b/openHAB/OpenHABSitemapViewController.swift index bc119334..5f467975 100644 --- a/openHAB/OpenHABSitemapViewController.swift +++ b/openHAB/OpenHABSitemapViewController.swift @@ -179,7 +179,7 @@ class OpenHABSitemapViewController: OpenHABViewController, GenericUITableViewCel OpenHABTracker.shared.restart() } else { if !pageNetworkStatusChanged() { - os_log("OpenHABSitemapViewController pageUrl = %{PUBLIC}@", log: .notifications, type: .info, pageUrl) + os_log("OpenHABSitemapViewController pageUrl = %{public}@", log: .notifications, type: .info, pageUrl) loadPage(false) } else { os_log("OpenHABSitemapViewController network status changed while I was not appearing", log: .viewCycle, type: .info) @@ -311,7 +311,7 @@ class OpenHABSitemapViewController: OpenHABViewController, GenericUITableViewCel if pageUrl == "" { return } - os_log("pageUrl = %{PUBLIC}@", log: OSLog.remoteAccess, type: .info, pageUrl) + os_log("pageUrl = %{public}@", log: OSLog.remoteAccess, type: .info, pageUrl) // If this is the first request to the page make a bulk call to pageNetworkStatusChanged // to save current reachability status. @@ -333,18 +333,18 @@ class OpenHABSitemapViewController: OpenHABViewController, GenericUITableViewCel NetworkConnection.atmosphereTrackingId = headers?["X-Atmosphere-tracking-id"] as? String ?? "" if !NetworkConnection.atmosphereTrackingId.isEmpty { - os_log("Found X-Atmosphere-tracking-id: %{PUBLIC}@", log: .remoteAccess, type: .info, NetworkConnection.atmosphereTrackingId) + os_log("Found X-Atmosphere-tracking-id: %{public}@", log: .remoteAccess, type: .info, NetworkConnection.atmosphereTrackingId) } var openHABSitemapPage: OpenHABSitemapPage? // If we are talking to openHAB 1.X, talk XML if appData?.openHABVersion == 1 { let str = String(decoding: data, as: UTF8.self) - os_log("%{PUBLIC}@", log: .remoteAccess, type: .info, str) + os_log("%{public}@", log: .remoteAccess, type: .info, str) guard let doc = try? XMLDocument(data: data) else { return } if let rootElement = doc.root, let name = rootElement.tag { - os_log("XML sitemap with root element: %{PUBLIC}@", log: .remoteAccess, type: .info, name) + os_log("XML sitemap with root element: %{public}@", log: .remoteAccess, type: .info, name) if name == "page" { openHABSitemapPage = OpenHABSitemapPage(xml: rootElement) } @@ -360,7 +360,7 @@ class OpenHABSitemapViewController: OpenHABViewController, GenericUITableViewCel return sitemapPageCodingData.openHABSitemapPage }() } catch { - os_log("Should not throw %{PUBLIC}@", log: OSLog.remoteAccess, type: .error, error.localizedDescription) + os_log("Should not throw %{public}@", log: OSLog.remoteAccess, type: .error, error.localizedDescription) } } @@ -383,7 +383,7 @@ class OpenHABSitemapViewController: OpenHABViewController, GenericUITableViewCel loadPage(true) case let .failure(error): - os_log("On LoadPage \"%{PUBLIC}@\" code: %d ", log: .remoteAccess, type: .error, error.localizedDescription, response.response?.statusCode ?? 0) + os_log("On LoadPage \"%{public}@\" code: %d ", log: .remoteAccess, type: .error, error.localizedDescription, response.response?.statusCode ?? 0) NetworkConnection.atmosphereTrackingId = "" if (error as NSError?)?.code == -1001, longPolling { @@ -440,7 +440,7 @@ class OpenHABSitemapViewController: OpenHABViewController, GenericUITableViewCel } self.widgetTableView.reloadData() case let .failure(error): - os_log("%{PUBLIC}@ %d", log: .default, type: .error, error.localizedDescription, response.response?.statusCode ?? 0) + os_log("%{public}@ %d", log: .default, type: .error, error.localizedDescription, response.response?.statusCode ?? 0) DispatchQueue.main.async { // Error if (error as NSError?)?.code == -1012 { @@ -540,18 +540,18 @@ class OpenHABSitemapViewController: OpenHABViewController, GenericUITableViewCel extension OpenHABSitemapViewController: OpenHABTrackerDelegate { func openHABTracked(_ openHABUrl: URL?, version: Int) { - os_log("OpenHABSitemapViewController openHAB URL = %{PUBLIC}@", log: .remoteAccess, type: .error, "\(openHABUrl!)") + os_log("OpenHABSitemapViewController openHAB URL = %{public}@", log: .remoteAccess, type: .error, "\(openHABUrl!)") openHABRootUrl = openHABUrl?.absoluteString ?? "" selectSitemap() } func openHABTrackingProgress(_ message: String?) { - os_log("OpenHABSitemapViewController %{PUBLIC}@", log: .viewCycle, type: .info, message ?? "") + os_log("OpenHABSitemapViewController %{public}@", log: .viewCycle, type: .info, message ?? "") showPopupMessage(seconds: 1.5, title: NSLocalizedString("connecting", comment: ""), message: message ?? "", theme: .info) } func openHABTrackingError(_ error: Error) { - os_log("Tracking error: %{PUBLIC}@", log: .viewCycle, type: .info, error.localizedDescription) + os_log("Tracking error: %{public}@", log: .viewCycle, type: .info, error.localizedDescription) showPopupMessage(seconds: 60, title: NSLocalizedString("error", comment: ""), message: error.localizedDescription, theme: .error) } } @@ -704,9 +704,9 @@ extension OpenHABSitemapViewController: UITableViewDelegate, UITableViewDataSour let reportOnResults: ((Swift.Result) -> Void)? = { result in switch result { case let .success(value): - os_log("Task done for: %{PUBLIC}@", log: .viewCycle, type: .info, value.source.url?.absoluteString ?? "") + os_log("Task done for: %{public}@", log: .viewCycle, type: .info, value.source.url?.absoluteString ?? "") case let .failure(error): - os_log("Job failed: %{PUBLIC}@", log: .viewCycle, type: .info, error.localizedDescription) + os_log("Job failed: %{public}@", log: .viewCycle, type: .info, error.localizedDescription) } } @@ -758,7 +758,7 @@ extension OpenHABSitemapViewController: UITableViewDelegate, UITableViewDataSour let widget: OpenHABWidget? = relevantWidget(indexPath: indexPath) if widget?.linkedPage != nil { if let link = widget?.linkedPage?.link { - os_log("Selected %{PUBLIC}@", log: .viewCycle, type: .info, link) + os_log("Selected %{public}@", log: .viewCycle, type: .info, link) } selectedWidgetRow = indexPath.row let newViewController = (storyboard?.instantiateViewController(withIdentifier: "OpenHABPageViewController") as? OpenHABSitemapViewController)! diff --git a/openHAB/OpenHABTracker.swift b/openHAB/OpenHABTracker.swift index 0933f9be..59645eeb 100644 --- a/openHAB/OpenHABTracker.swift +++ b/openHAB/OpenHABTracker.swift @@ -75,7 +75,7 @@ class OpenHABTracker: NSObject { restartTimer = Timer.scheduledTimer(withTimeInterval: 3.0, repeats: false) { _ in if nStatus != self.oldReachabilityStatus { if let oldReachabilityStatus = self.oldReachabilityStatus { - os_log("OpenHABTracker Network status changed from %{PUBLIC}@ to %{PUBLIC}@", log: OSLog.remoteAccess, type: .info, self.string(from: oldReachabilityStatus) ?? "", self.string(from: nStatus) ?? "") + os_log("OpenHABTracker Network status changed from %{public}@ to %{public}@", log: OSLog.remoteAccess, type: .info, self.string(from: oldReachabilityStatus) ?? "", self.string(from: nStatus) ?? "") } self.oldReachabilityStatus = nStatus if self.isNetworkConnected() { @@ -145,7 +145,7 @@ class OpenHABTracker: NSObject { multicastDelegate.invoke { $0.openHABTrackingProgress(NSLocalizedString("connecting", comment: "")) } tryUrls(urls) { url, version, error in if let error { - os_log("OpenHABTracker failed %{PUBLIC}@", log: .default, type: .info, error.localizedDescription) + os_log("OpenHABTracker failed %{public}@", log: .default, type: .info, error.localizedDescription) self.multicastDelegate.invoke { $0.openHABTrackingError(error) } } else { self.appData?.openHABVersion = version @@ -177,7 +177,7 @@ class OpenHABTracker: NSObject { request.responseData { response in // remove us from the outstanding request list requests.removeValue(forKey: url) - os_log("OpenHABTracker response for URL %{PUBLIC}@", log: .notifications, type: .error, url.absoluteString) + os_log("OpenHABTracker response for URL %{public}@", log: .notifications, type: .error, url.absoluteString) switch response.result { case let .success(data): let version = self.getServerInfoFromData(data: data) @@ -190,7 +190,7 @@ class OpenHABTracker: NSObject { completion(url, version, nil) } case let .failure(error): - os_log("OpenHABTracker request failure %{PUBLIC}@", log: .notifications, type: .error, error.localizedDescription) + os_log("OpenHABTracker request failure %{public}@", log: .notifications, type: .error, error.localizedDescription) } // check if we are the last attempt if !isRequestCompletedSuccessfully, requests.isEmpty, timers.isEmpty { @@ -232,9 +232,9 @@ class OpenHABTracker: NSObject { /// - completion: Completes with the url and version of openHAB that succeeded, or an Error object if failed private func getServerInfoForUrl(_ url: URL?, completion: @escaping (URL?, Int, Error?) -> Void) { let strUrl = url?.absoluteString ?? "" - os_log("OpenHABTracker getServerInfo, trying: %{PUBLIC}@", log: .default, type: .info, strUrl) + os_log("OpenHABTracker getServerInfo, trying: %{public}@", log: .default, type: .info, strUrl) NetworkConnection.tracker(openHABRootUrl: strUrl) { response in - os_log("OpenHABTracker getServerInfo, recieved data for URL: %{PUBLIC}@", log: .default, type: .info, strUrl) + os_log("OpenHABTracker getServerInfo, recieved data for URL: %{public}@", log: .default, type: .info, strUrl) switch response.result { case let .success(data): let version = self.getServerInfoFromData(data: data) @@ -244,7 +244,7 @@ class OpenHABTracker: NSObject { completion(url, 0, self.errorMessage("error")) } case let .failure(error): - os_log("OpenHABTracker getServerInfo ERROR for %{PUBLIC}@ : %{PUBLIC}@ %d", log: .remoteAccess, type: .error, strUrl, error.localizedDescription, response.response?.statusCode ?? 0) + os_log("OpenHABTracker getServerInfo ERROR for %{public}@ : %{public}@ %d", log: .remoteAccess, type: .error, strUrl, error.localizedDescription, response.response?.statusCode ?? 0) completion(url, 0, error) } } @@ -310,7 +310,7 @@ extension OpenHABTracker: NetServiceDelegate, NetServiceBrowserDelegate { }() let openhabUrl = "\(resolvedComponents.url!)" - os_log("OpenHABTracker discovered:%{PUBLIC}@ ", log: OSLog.remoteAccess, type: .info, openhabUrl) + os_log("OpenHABTracker discovered:%{public}@ ", log: OSLog.remoteAccess, type: .info, openhabUrl) tryDiscoveryUrl(resolvedComponents.url) } diff --git a/openHAB/OpenHABWebViewController.swift b/openHAB/OpenHABWebViewController.swift index cfa9812a..dccc4c65 100644 --- a/openHAB/OpenHABWebViewController.swift +++ b/openHAB/OpenHABWebViewController.swift @@ -94,7 +94,7 @@ class OpenHABWebViewController: OpenHABViewController { } func loadWebView(force: Bool = false, path: String? = nil) { - os_log("loadWebView %{PUBLIC}@", log: OSLog.remoteAccess, type: .info, openHABTrackedRootUrl) + os_log("loadWebView %{public}@", log: OSLog.remoteAccess, type: .info, openHABTrackedRootUrl) let authStr = "\(Preferences.username):\(Preferences.password)" let newTarget = "\(openHABTrackedRootUrl):\(authStr)" @@ -165,7 +165,7 @@ class OpenHABWebViewController: OpenHABViewController { } func clearExistingPage() { - os_log("clearExistingPage - webView.url %{PUBLIC}@", log: .wkwebview, type: .info, String(describing: webView.url?.description)) + os_log("clearExistingPage - webView.url %{public}@", log: .wkwebview, type: .info, String(describing: webView.url?.description)) setHideNavBar(shouldHide: false) // clear out existing page while we load. webView.stopLoading() @@ -173,7 +173,7 @@ class OpenHABWebViewController: OpenHABViewController { } func pageLoadError(message: String) { - os_log("pageLoadError - webView.url %{PUBLIC}@ %{PUBLIC}@", log: .wkwebview, type: .info, String(describing: webView.url?.description), message) + os_log("pageLoadError - webView.url %{public}@ %{public}@", log: .wkwebview, type: .info, String(describing: webView.url?.description), message) showActivityIndicator(show: false) // webView.loadHTMLString("Page Not Found", baseURL: URL(string: "https://openHAB.org/")) showPopupMessage(seconds: 60, title: NSLocalizedString("error", comment: ""), message: message, theme: .error) @@ -203,7 +203,7 @@ class OpenHABWebViewController: OpenHABViewController { let jsCode = "window.MainUI.handleCommand('\(command)')" webView.evaluateJavaScript(jsCode) { (_, error) in if let error { - os_log("navigateCommandInternal failed %{PUBLIC}@", log: .wkwebview, type: .error, error.localizedDescription) + os_log("navigateCommandInternal failed %{public}@", log: .wkwebview, type: .error, error.localizedDescription) } else { os_log("navigateCommandInternal Success", log: .wkwebview, type: .info) } @@ -241,7 +241,7 @@ class OpenHABWebViewController: OpenHABViewController { if let webviewURL = webView.url { let url = URL(string: webviewURL.path, relativeTo: URL(string: self.openHABTrackedRootUrl)) if let path = url?.path { - os_log("navigation change base: %{PUBLIC}@ path: %{PUBLIC}@", log: OSLog.default, type: .info, self.openHABTrackedRootUrl, path) + os_log("navigation change base: %{public}@ path: %{public}@", log: OSLog.default, type: .info, self.openHABTrackedRootUrl, path) // append trailing slash as WebUI/Vue/F7 will try and issue a 302 if the url is navigated to directly, this can be problamatic on myopenHAB self.appData?.currentWebViewPath = path.hasSuffix("/") ? path : path + "/" } @@ -257,9 +257,9 @@ class OpenHABWebViewController: OpenHABViewController { extension OpenHABWebViewController: WKScriptMessageHandler { func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) { - os_log("WKScriptMessage %{PUBLIC}@", log: OSLog.remoteAccess, type: .info, message.name) + os_log("WKScriptMessage %{public}@", log: OSLog.remoteAccess, type: .info, message.name) if let callbackName = message.body as? String { - os_log("WKScriptMessage %{PUBLIC}@", log: OSLog.remoteAccess, type: .info, callbackName) + os_log("WKScriptMessage %{public}@", log: OSLog.remoteAccess, type: .info, callbackName) switch callbackName { case "exitToApp": showSideMenu() @@ -299,7 +299,7 @@ extension OpenHABWebViewController: WKNavigationDelegate { } guard let url = navigationAction.request.url else { return } - os_log("decidePolicyFor - url: %{PUBLIC}@", log: .wkwebview, type: .info, url.absoluteString) + os_log("decidePolicyFor - url: %{public}@", log: .wkwebview, type: .info, url.absoluteString) if navigationAction.navigationType == .linkActivated { action = .cancel // Stop in WebView @@ -311,7 +311,7 @@ extension OpenHABWebViewController: WKNavigationDelegate { decisionHandler: @escaping (WKNavigationResponsePolicy) -> Void) { if let response = navigationResponse.response as? HTTPURLResponse { dump(response.allHeaderFields) - os_log("navigationResponse: %{PUBLIC}@", log: .wkwebview, type: .info, String(response.statusCode)) + os_log("navigationResponse: %{public}@", log: .wkwebview, type: .info, String(response.statusCode)) if response.statusCode >= 400 { pageLoadError(message: "\(response.statusCode)") decisionHandler(.cancel) @@ -322,12 +322,12 @@ extension OpenHABWebViewController: WKNavigationDelegate { } func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) { - os_log("didStartProvisionalNavigation - webView.url: %{PUBLIC}@", log: .wkwebview, type: .info, String(describing: webView.url?.description)) + os_log("didStartProvisionalNavigation - webView.url: %{public}@", log: .wkwebview, type: .info, String(describing: webView.url?.description)) showActivityIndicator(show: true) } func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) { - os_log("didFail - webView.url %{PUBLIC}@", log: .wkwebview, type: .info, String(describing: webView.url?.description)) + os_log("didFail - webView.url %{public}@", log: .wkwebview, type: .info, String(describing: webView.url?.description)) let nserror = error as NSError if nserror.code != NSURLErrorCancelled { pageLoadError(message: nserror.localizedDescription) @@ -335,14 +335,14 @@ extension OpenHABWebViewController: WKNavigationDelegate { } func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { - os_log("didFinish - webView.url %{PUBLIC}@", log: .wkwebview, type: .info, String(describing: webView.url?.description)) + os_log("didFinish - webView.url %{public}@", log: .wkwebview, type: .info, String(describing: webView.url?.description)) showActivityIndicator(show: false) hidePopupMessages() } func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { - os_log("Challenge.protectionSpace.authtenticationMethod: %{PUBLIC}@", log: .wkwebview, type: .info, String(describing: challenge.protectionSpace.authenticationMethod)) + os_log("Challenge.protectionSpace.authtenticationMethod: %{public}@", log: .wkwebview, type: .info, String(describing: challenge.protectionSpace.authenticationMethod)) if let url = modifyUrl(orig: URL(string: openHABTrackedRootUrl)), challenge.protectionSpace.host == url.host { // openHABTracker takes care of triggering server trust prompts @@ -403,7 +403,7 @@ extension OpenHABWebViewController: WKUIDelegate { extension OpenHABWebViewController: OpenHABTrackerDelegate { func openHABTracked(_ openHABUrl: URL?, version: Int) { - os_log("OpenHABWebViewController openHAB URL = %{PUBLIC}@", log: .remoteAccess, type: .error, "\(openHABUrl!)") + os_log("OpenHABWebViewController openHAB URL = %{public}@", log: .remoteAccess, type: .error, "\(openHABUrl!)") if version >= 2 { openHABTrackedRootUrl = openHABUrl?.absoluteString ?? "" loadWebView(force: false) @@ -414,12 +414,12 @@ extension OpenHABWebViewController: OpenHABTrackerDelegate { } func openHABTrackingProgress(_ message: String?) { - os_log("OpenHABViewController %{PUBLIC}@", log: .viewCycle, type: .info, message ?? "") + os_log("OpenHABViewController %{public}@", log: .viewCycle, type: .info, message ?? "") showPopupMessage(seconds: 1.5, title: NSLocalizedString("connecting", comment: ""), message: message ?? "", theme: .info) } func openHABTrackingError(_ error: Error) { - os_log("Tracking error: %{PUBLIC}@", log: .viewCycle, type: .info, error.localizedDescription) + os_log("Tracking error: %{public}@", log: .viewCycle, type: .info, error.localizedDescription) pageLoadError(message: error.localizedDescription) } } diff --git a/openHAB/VideoUITableViewCell.swift b/openHAB/VideoUITableViewCell.swift index 81364d68..90d63155 100644 --- a/openHAB/VideoUITableViewCell.swift +++ b/openHAB/VideoUITableViewCell.swift @@ -130,10 +130,10 @@ class VideoUITableViewCell: GenericUITableViewCell { playerObserver = playerItem.observe(\.status, options: [.new, .old]) { [weak self] playerItem, _ in switch playerItem.status { case .failed: - os_log("Failed to load video with URL: %{PUBLIC}@", log: .urlComposition, type: .debug, url.absoluteString) + os_log("Failed to load video with URL: %{public}@", log: .urlComposition, type: .debug, url.absoluteString) self?.url = nil case .readyToPlay: - os_log("Loaded video with URL: %{PUBLIC}@", log: .urlComposition, type: .debug, url.absoluteString) + os_log("Loaded video with URL: %{public}@", log: .urlComposition, type: .debug, url.absoluteString) default: return } diff --git a/openHAB/WatchMessageService.swift b/openHAB/WatchMessageService.swift index 5de90ff2..b7c6ab63 100644 --- a/openHAB/WatchMessageService.swift +++ b/openHAB/WatchMessageService.swift @@ -22,7 +22,7 @@ class WatchMessageService: NSObject, WCSessionDelegate { // This method gets called when the watch requests the data func session(_ session: WCSession, didReceiveMessage message: [String: Any], replyHandler: @escaping ([String: Any]) -> Void) { // TODO: Use RemoteUrl, TOO - os_log("didReceiveMessage %{PUBLIC}@", log: .watch, type: .info, "\(message)") + os_log("didReceiveMessage %{public}@", log: .watch, type: .info, "\(message)") if message["request"] != nil { let applicationDict = buildApplicationDict() @@ -31,11 +31,11 @@ class WatchMessageService: NSObject, WCSessionDelegate { } func session(_ session: WCSession, didReceiveMessage message: [String: Any]) { - os_log("Received message: %{PUBLIC}@", log: .watch, type: .info, message) + os_log("Received message: %{public}@", log: .watch, type: .info, message) } func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) { - os_log("activationDidCompleteWith activationState %{PUBLIC}@ error: %{PUBLIC}@", log: .watch, type: .info, "\(activationState)", "\(String(describing: error))") + os_log("activationDidCompleteWith activationState %{public}@ error: %{public}@", log: .watch, type: .info, "\(activationState)", "\(String(describing: error))") } func sessionDidBecomeInactive(_ session: WCSession) { diff --git a/openHAB/WebUITableViewCell.swift b/openHAB/WebUITableViewCell.swift index 2a187eba..58d34925 100644 --- a/openHAB/WebUITableViewCell.swift +++ b/openHAB/WebUITableViewCell.swift @@ -46,7 +46,7 @@ class WebUITableViewCell: GenericUITableViewCell { } override func displayWidget() { - os_log("webview loading url %{PUBLIC}@", log: .default, type: .info, widget.url) + os_log("webview loading url %{public}@", log: .default, type: .info, widget.url) let urlString = widget.url.lowercased().hasPrefix("http") ? widget.url : Preferences.localUrl + widget.url guard url?.absoluteString != urlString else { @@ -79,28 +79,28 @@ extension WebUITableViewCell: GenericCellCacheProtocol { extension WebUITableViewCell: WKNavigationDelegate { func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) { - os_log("webview started loading with URL: %{PUBLIC}s", log: .viewCycle, type: .info, widget.url) + os_log("webview started loading with URL: %{public}s", log: .viewCycle, type: .info, widget.url) } func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { - os_log("webview finished load with URL: %{PUBLIC}s", log: .viewCycle, type: .info, widget.url) + os_log("webview finished load with URL: %{public}s", log: .viewCycle, type: .info, widget.url) } func webView(_ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, decisionHandler: @escaping (WKNavigationResponsePolicy) -> Void) { if let response = navigationResponse.response as? HTTPURLResponse, response.statusCode >= 400 { - os_log("webview failed with status code: %{PUBLIC}i", log: .urlComposition, type: .debug, response.statusCode) + os_log("webview failed with status code: %{public}i", log: .urlComposition, type: .debug, response.statusCode) url = nil } decisionHandler(.allow) } func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) { - os_log("webview failed with error: %{PUBLIC}s", log: .urlComposition, type: .debug, error.localizedDescription) + os_log("webview failed with error: %{public}s", log: .urlComposition, type: .debug, error.localizedDescription) url = nil } func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) { - os_log("webview failed with error: %{PUBLIC}s", log: .urlComposition, type: .debug, error.localizedDescription) + os_log("webview failed with error: %{public}s", log: .urlComposition, type: .debug, error.localizedDescription) url = nil } diff --git a/openHABIntents/GetItemStateIntentHandler.swift b/openHABIntents/GetItemStateIntentHandler.swift index ec966428..294059fb 100644 --- a/openHABIntents/GetItemStateIntentHandler.swift +++ b/openHABIntents/GetItemStateIntentHandler.swift @@ -36,7 +36,7 @@ class GetItemStateIntentHandler: NSObject, OpenHABGetItemStateIntentHandling { } func handle(intent: OpenHABGetItemStateIntent, completion: @escaping (OpenHABGetItemStateIntentResponse) -> Void) { - os_log("GetItemStateIntent for %{PUBLIC}@", log: .default, type: .info, intent.item ?? "") + os_log("GetItemStateIntent for %{public}@", log: .default, type: .info, intent.item ?? "") guard let itemName = intent.item else { completion(OpenHABGetItemStateIntentResponse.failureInvalidItem(NSLocalizedString("empty", comment: "empty item name"))) diff --git a/openHABIntents/SetColorValueIntentHandler.swift b/openHABIntents/SetColorValueIntentHandler.swift index fc9d2ce1..77477069 100644 --- a/openHABIntents/SetColorValueIntentHandler.swift +++ b/openHABIntents/SetColorValueIntentHandler.swift @@ -36,7 +36,7 @@ class SetColorValueIntentHandler: NSObject, OpenHABSetColorValueIntentHandling { } func handle(intent: OpenHABSetColorValueIntent, completion: @escaping (OpenHABSetColorValueIntentResponse) -> Void) { - os_log("SetColorValueIntent for %{PUBLIC}@", log: .default, type: .info, intent.item ?? "") + os_log("SetColorValueIntent for %{public}@", log: .default, type: .info, intent.item ?? "") guard let itemName = intent.item else { completion(OpenHABSetColorValueIntentResponse.failureInvalidItem(NSLocalizedString("empty", comment: "empty item name"))) diff --git a/openHABIntents/SetContactStateValueIntentHandler.swift b/openHABIntents/SetContactStateValueIntentHandler.swift index d9de0359..4e5049c4 100644 --- a/openHABIntents/SetContactStateValueIntentHandler.swift +++ b/openHABIntents/SetContactStateValueIntentHandler.swift @@ -48,7 +48,7 @@ class SetContactStateValueIntentHandler: NSObject, OpenHABSetContactStateValueIn } func handle(intent: OpenHABSetContactStateValueIntent, completion: @escaping (OpenHABSetContactStateValueIntentResponse) -> Void) { - os_log("SetContactStateValueIntent for %{PUBLIC}@", log: .default, type: .info, intent.item ?? "") + os_log("SetContactStateValueIntent for %{public}@", log: .default, type: .info, intent.item ?? "") guard let itemName = intent.item else { completion(OpenHABSetContactStateValueIntentResponse.failureInvalidItem(NSLocalizedString("empty", comment: "empty item name"))) diff --git a/openHABIntents/SetDimmerRollerValueIntentHandler.swift b/openHABIntents/SetDimmerRollerValueIntentHandler.swift index 400b3615..8f09967d 100644 --- a/openHABIntents/SetDimmerRollerValueIntentHandler.swift +++ b/openHABIntents/SetDimmerRollerValueIntentHandler.swift @@ -36,7 +36,7 @@ class SetDimmerRollerValueIntentHandler: NSObject, OpenHABSetDimmerRollerValueIn } func handle(intent: OpenHABSetDimmerRollerValueIntent, completion: @escaping (OpenHABSetDimmerRollerValueIntentResponse) -> Void) { - os_log("SetDimmerRollerValueIntent for %{PUBLIC}@", log: .default, type: .info, intent.item ?? "") + os_log("SetDimmerRollerValueIntent for %{public}@", log: .default, type: .info, intent.item ?? "") guard let itemName = intent.item else { completion(OpenHABSetDimmerRollerValueIntentResponse.failureInvalidItem(NSLocalizedString("empty", comment: "empty item name"))) diff --git a/openHABIntents/SetNumberValueIntentHandler.swift b/openHABIntents/SetNumberValueIntentHandler.swift index 9135422c..0a6d5428 100644 --- a/openHABIntents/SetNumberValueIntentHandler.swift +++ b/openHABIntents/SetNumberValueIntentHandler.swift @@ -36,7 +36,7 @@ class SetNumberValueIntentHandler: NSObject, OpenHABSetNumberValueIntentHandling } func handle(intent: OpenHABSetNumberValueIntent, completion: @escaping (OpenHABSetNumberValueIntentResponse) -> Void) { - os_log("SetNumberValueIntent for %{PUBLIC}@", log: .default, type: .info, intent.item ?? "") + os_log("SetNumberValueIntent for %{public}@", log: .default, type: .info, intent.item ?? "") guard let itemName = intent.item else { completion(OpenHABSetNumberValueIntentResponse.failureInvalidItem(NSLocalizedString("empty", comment: "empty item name"))) diff --git a/openHABIntents/SetStringValueIntentHandler.swift b/openHABIntents/SetStringValueIntentHandler.swift index 372ccc3e..1351750b 100644 --- a/openHABIntents/SetStringValueIntentHandler.swift +++ b/openHABIntents/SetStringValueIntentHandler.swift @@ -36,7 +36,7 @@ class SetStringValueIntentHandler: NSObject, OpenHABSetStringValueIntentHandling } func handle(intent: OpenHABSetStringValueIntent, completion: @escaping (OpenHABSetStringValueIntentResponse) -> Void) { - os_log("SetStringValueIntent for %{PUBLIC}@", log: .default, type: .info, intent.item ?? "") + os_log("SetStringValueIntent for %{public}@", log: .default, type: .info, intent.item ?? "") guard let itemName = intent.item else { completion(OpenHABSetStringValueIntentResponse.failureInvalidItem(NSLocalizedString("empty", comment: "empty item name"))) diff --git a/openHABIntents/SetSwitchStateIntentHandler.swift b/openHABIntents/SetSwitchStateIntentHandler.swift index f2c2f99a..d135267e 100644 --- a/openHABIntents/SetSwitchStateIntentHandler.swift +++ b/openHABIntents/SetSwitchStateIntentHandler.swift @@ -48,7 +48,7 @@ class SetSwitchStateIntentHandler: NSObject, OpenHABSetSwitchStateIntentHandling } func handle(intent: OpenHABSetSwitchStateIntent, completion: @escaping (OpenHABSetSwitchStateIntentResponse) -> Void) { - os_log("SetSwitchStateIntent for %{PUBLIC}@", log: .default, type: .info, intent.item ?? "") + os_log("SetSwitchStateIntent for %{public}@", log: .default, type: .info, intent.item ?? "") guard let itemName = intent.item else { completion(OpenHABSetSwitchStateIntentResponse.failureInvalidItem(NSLocalizedString("empty", comment: "empty item name"))) diff --git a/openHABWatch Extension/OpenHABWatchTracker.swift b/openHABWatch Extension/OpenHABWatchTracker.swift index 7dc6fcf1..fd93d010 100644 --- a/openHABWatch Extension/OpenHABWatchTracker.swift +++ b/openHABWatch Extension/OpenHABWatchTracker.swift @@ -48,7 +48,7 @@ class OpenHABWatchTracker: NSObject { let nStatus = path if nStatus != oldReachabilityStatus { if let oldReachabilityStatus { - os_log("Network status changed from %{PUBLIC}@ to %{PUBLIC}@", log: OSLog.remoteAccess, type: .info, oldReachabilityStatus.debugDescription, nStatus.debugDescription) + os_log("Network status changed from %{public}@ to %{public}@", log: OSLog.remoteAccess, type: .info, oldReachabilityStatus.debugDescription, nStatus.debugDescription) } oldReachabilityStatus = nStatus (delegate as? OpenHABWatchTrackerExtendedDelegate)?.openHABTrackingNetworkChange(nStatus) @@ -176,7 +176,7 @@ class OpenHABWatchTracker: NSObject { case .ready: os_log("OpenHABWatchTracker discovery ready", log: .default, type: .info) case let .failed(error): - os_log("OpenHABWatchTracker discovery failed: %{PUBLIC}@", log: .default, type: .info, error.localizedDescription) + os_log("OpenHABWatchTracker discovery failed: %{public}@", log: .default, type: .info, error.localizedDescription) self.trackedRemoteUrl() default: break @@ -188,7 +188,7 @@ class OpenHABWatchTracker: NSObject { switch result.endpoint { case let .service(name, type, domain, interface): - os_log("OpenHABWatchTracker discovered service: name=%{PUBLIC}@ type=%{PUBLIC}@ domain=%{PUBLIC}@", log: OSLog.remoteAccess, type: .info, name, type, domain) + os_log("OpenHABWatchTracker discovered service: name=%{public}@ type=%{public}@ domain=%{public}@", log: OSLog.remoteAccess, type: .info, name, type, domain) let params = NWParameters.tcp let endpoint = NWEndpoint.service(name: name, type: type, domain: domain, interface: interface) let connection = NWConnection(to: endpoint, using: params) @@ -215,7 +215,7 @@ class OpenHABWatchTracker: NSObject { os_log("OpenHABWatchTracker unable to build URL from discovered endpoint, using remote URL instead", log: OSLog.remoteAccess, type: .info) self.trackedRemoteUrl() } else { - os_log("OpenHABWatchTracker discovered: %{PUBLIC}@ ", log: OSLog.remoteAccess, type: .info, components.url?.description ?? "") + os_log("OpenHABWatchTracker discovered: %{public}@ ", log: OSLog.remoteAccess, type: .info, components.url?.description ?? "") self.trackedDiscoveryUrl(components.url) } return diff --git a/openHABWatch Extension/Views/Rows/ImageRow.swift b/openHABWatch Extension/Views/Rows/ImageRow.swift index a4eb3f9d..3947e97a 100644 --- a/openHABWatch Extension/Views/Rows/ImageRow.swift +++ b/openHABWatch Extension/Views/Rows/ImageRow.swift @@ -20,10 +20,10 @@ struct ImageRow: View { var body: some View { KFImage(URL) .onSuccess { retrieveImageResult in - os_log("Success loading icon: %{PUBLIC}s", log: .notifications, type: .debug, "\(retrieveImageResult)") + os_log("Success loading icon: %{public}s", log: .notifications, type: .debug, "\(retrieveImageResult)") } .onFailure { kingfisherError in - os_log("Failure loading icon: %{PUBLIC}s", log: .notifications, type: .debug, kingfisherError.localizedDescription) + os_log("Failure loading icon: %{public}s", log: .notifications, type: .debug, kingfisherError.localizedDescription) } .placeholder { Image(systemName: "arrow.2.circlepath.circle") diff --git a/openHABWatch Extension/Views/Utils/IconView.swift b/openHABWatch Extension/Views/Utils/IconView.swift index 6714ce44..6c54f19e 100644 --- a/openHABWatch Extension/Views/Utils/IconView.swift +++ b/openHABWatch Extension/Views/Utils/IconView.swift @@ -36,10 +36,10 @@ struct IconView: View { ))) : KFImage(iconURL) return image .onSuccess { retrieveImageResult in - os_log("Success loading icon: %{PUBLIC}s", log: .notifications, type: .debug, "\(retrieveImageResult)") + os_log("Success loading icon: %{public}s", log: .notifications, type: .debug, "\(retrieveImageResult)") } .onFailure { kingfisherError in - os_log("Failure loading icon: %{PUBLIC}s", log: .notifications, type: .debug, kingfisherError.localizedDescription) + os_log("Failure loading icon: %{public}s", log: .notifications, type: .debug, kingfisherError.localizedDescription) } .placeholder { Image(systemName: "arrow.2.circlepath.circle") diff --git a/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABSitemapPage.swift b/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABSitemapPage.swift index 1efc1105..56d9b7b2 100644 --- a/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABSitemapPage.swift +++ b/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABSitemapPage.swift @@ -77,7 +77,7 @@ class ObservableOpenHABSitemapPage: NSObject { private func sendCommand(_ item: OpenHABItem?, commandToSend command: String?) { guard let item else { return } - os_log("SitemapPage sending command %{PUBLIC}@ to %{PUBLIC}@", log: OSLog.remoteAccess, type: .info, command ?? "", item.name) + os_log("SitemapPage sending command %{public}@ to %{public}@", log: OSLog.remoteAccess, type: .info, command ?? "", item.name) sendCommand?(item, command) } } diff --git a/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABWidgetExtension.swift b/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABWidgetExtension.swift index a64601ab..ae093098 100644 --- a/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABWidgetExtension.swift +++ b/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABWidgetExtension.swift @@ -18,7 +18,7 @@ extension ObservableOpenHABWidget { if let linkedPage { let title = linkedPage.title.components(separatedBy: "[")[0] let pageUrl = linkedPage.link - // os_log("Selected %{PUBLIC}@", log: .viewCycle, type: .info, pageUrl) + // os_log("Selected %{public}@", log: .viewCycle, type: .info, pageUrl) NavigationLink(destination: LazyView( ContentView(viewModel: UserData(url: URL(string: pageUrl)), settings: settings, title: title)) diff --git a/openHABWatch Extension/openHABWatch Extension/UserData.swift b/openHABWatch Extension/openHABWatch Extension/UserData.swift index 85774cd3..a52a7f75 100644 --- a/openHABWatch Extension/openHABWatch Extension/UserData.swift +++ b/openHABWatch Extension/openHABWatch Extension/UserData.swift @@ -55,7 +55,7 @@ final class UserData: ObservableObject { return sitemapPageCodingData.openHABSitemapPage }() } catch { - os_log("Should not throw %{PUBLIC}@", log: OSLog.remoteAccess, type: .error, error.localizedDescription) + os_log("Should not throw %{public}@", log: OSLog.remoteAccess, type: .error, error.localizedDescription) } widgets = openHABSitemapPage?.widgets ?? [] @@ -129,7 +129,7 @@ final class UserData: ObservableObject { promise.resolve(with: data) case let .failure(error): - os_log("On LoadPage %{PUBLIC}@ code: %d ", log: .remoteAccess, type: .error, error.localizedDescription, response.response?.statusCode ?? 0) + os_log("On LoadPage %{public}@ code: %d ", log: .remoteAccess, type: .error, error.localizedDescription, response.response?.statusCode ?? 0) promise.reject(with: error) } } @@ -167,7 +167,7 @@ final class UserData: ObservableObject { return sitemapPageCodingData.openHABSitemapPage }() } catch { - os_log("Should not throw %{PUBLIC}@", log: OSLog.remoteAccess, type: .error, error.localizedDescription) + os_log("Should not throw %{public}@", log: OSLog.remoteAccess, type: .error, error.localizedDescription) } openHABSitemapPage?.sendCommand = { [weak self] item, command in @@ -184,7 +184,7 @@ final class UserData: ObservableObject { ) } case let .failure(error): - os_log("On LoadPage %{PUBLIC}@ code: %d ", log: .remoteAccess, type: .error, error.localizedDescription, response.response?.statusCode ?? 0) + os_log("On LoadPage %{public}@ code: %d ", log: .remoteAccess, type: .error, error.localizedDescription, response.response?.statusCode ?? 0) errorDescription = error.localizedDescription widgets = [] showAlert = true @@ -218,7 +218,7 @@ final class UserData: ObservableObject { .observe { result in switch result { case let .failure(error): - os_log("On LoadPage %{PUBLIC}@", log: .remoteAccess, type: .error, error.localizedDescription) + os_log("On LoadPage %{public}@", log: .remoteAccess, type: .error, error.localizedDescription) case let .success(page): self.openHABSitemapPage = page } @@ -229,7 +229,7 @@ final class UserData: ObservableObject { extension UserData: OpenHABWatchTrackerDelegate { func openHABTracked(_ openHABUrl: URL?) { guard let urlString = openHABUrl?.absoluteString else { return } - os_log("openHABTracked: %{PUBLIC}@", log: .remoteAccess, type: .error, urlString) + os_log("openHABTracked: %{public}@", log: .remoteAccess, type: .error, urlString) if !ObservableOpenHABDataObject.shared.haveReceivedAppContext { AppMessageService.singleton.requestApplicationContext() @@ -245,10 +245,10 @@ extension UserData: OpenHABWatchTrackerDelegate { } func openHABTrackingProgress(_ message: String?) { - os_log("openHABTrackingProgress: %{PUBLIC}@", log: .remoteAccess, type: .error, message ?? "") + os_log("openHABTrackingProgress: %{public}@", log: .remoteAccess, type: .error, message ?? "") } func openHABTrackingError(_ error: Error) { - os_log("openHABTrackingError: %{PUBLIC}@", log: .remoteAccess, type: .error, error.localizedDescription) + os_log("openHABTrackingError: %{public}@", log: .remoteAccess, type: .error, error.localizedDescription) } } diff --git a/openHABWatch Extension/openHABWatch Extension/external/AppMessageService.swift b/openHABWatch Extension/openHABWatch Extension/external/AppMessageService.swift index 5d3040c6..1dccc449 100644 --- a/openHABWatch Extension/openHABWatch Extension/external/AppMessageService.swift +++ b/openHABWatch Extension/openHABWatch Extension/external/AppMessageService.swift @@ -65,21 +65,21 @@ class AppMessageService: NSObject, WCSessionDelegate { ["request": "Preferences"], replyHandler: { (response) in let filteredMessages = response.filter { ["remoteUrl", "localUrl", "username"].contains($0.key) } - os_log("Received %{PUBLIC}@", log: .watch, type: .info, "\(filteredMessages)") + os_log("Received %{public}@", log: .watch, type: .info, "\(filteredMessages)") DispatchQueue.main.async { () in AppMessageService.singleton.updateValuesFromApplicationContext(response as [String: AnyObject]) } }, errorHandler: { (error) in - os_log("Error sending message %{PUBLIC}@", log: .watch, type: .info, "\(error)") + os_log("Error sending message %{public}@", log: .watch, type: .info, "\(error)") } ) } @available(watchOSApplicationExtension 2.2, *) func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) { - os_log("activationDidCompleteWith activationState %{PUBLIC}@ error: %{PUBLIC}@", log: .watch, type: .info, "\(activationState)", "\(String(describing: error))") + os_log("activationDidCompleteWith activationState %{public}@ error: %{public}@", log: .watch, type: .info, "\(activationState)", "\(String(describing: error))") DispatchQueue.main.async { () in self.updateValuesFromApplicationContext(session.receivedApplicationContext as [String: AnyObject]) } @@ -88,7 +88,7 @@ class AppMessageService: NSObject, WCSessionDelegate { /** Called on the delegate of the receiver. Will be called on startup if an applicationContext is available. */ @available(watchOS 2.0, *) func session(_ session: WCSession, didReceiveApplicationContext applicationContext: [String: Any]) { - os_log("didReceiveApplicationContext %{PUBLIC}@", log: .watch, type: .info, "\(applicationContext)") + os_log("didReceiveApplicationContext %{public}@", log: .watch, type: .info, "\(applicationContext)") DispatchQueue.main.async { () in self.updateValuesFromApplicationContext(applicationContext as [String: AnyObject]) } @@ -97,7 +97,7 @@ class AppMessageService: NSObject, WCSessionDelegate { /** Called on the delegate of the receiver. Will be called on startup if the user info finished transferring when the receiver was not running. */ @available(watchOS 2.0, *) func session(_ session: WCSession, didReceiveUserInfo userInfo: [String: Any]) { - os_log("didReceiveUserInfo %{PUBLIC}@", log: .watch, type: .info, "\(userInfo)") + os_log("didReceiveUserInfo %{public}@", log: .watch, type: .info, "\(userInfo)") DispatchQueue.main.async { () in self.updateValuesFromApplicationContext(userInfo as [String: AnyObject]) } @@ -106,7 +106,7 @@ class AppMessageService: NSObject, WCSessionDelegate { @available(watchOS 2.0, *) func session(_ session: WCSession, didReceiveMessage message: [String: Any]) { let filteredMessages = message.filter { ["remoteUrl", "localUrl", "username"].contains($0.key) } - os_log("didReceiveMessage some filtered messages: %{PUBLIC}@", log: .watch, type: .info, "\(filteredMessages)") + os_log("didReceiveMessage some filtered messages: %{public}@", log: .watch, type: .info, "\(filteredMessages)") DispatchQueue.main.async { () in self.updateValuesFromApplicationContext(message as [String: AnyObject]) } @@ -115,7 +115,7 @@ class AppMessageService: NSObject, WCSessionDelegate { @available(watchOS 2.0, *) func session(_ session: WCSession, didReceiveMessage message: [String: Any], replyHandler: @escaping ([String: Any]) -> Swift.Void) { let filteredMessages = message.filter { ["remoteUrl", "localUrl", "username", "defaultSitemap"].contains($0.key) } - os_log("didReceiveMessage some filtered messages: %{PUBLIC}@ with reply handler", log: .watch, type: .info, "\(filteredMessages)") + os_log("didReceiveMessage some filtered messages: %{public}@ with reply handler", log: .watch, type: .info, "\(filteredMessages)") DispatchQueue.main.async { () in self.updateValuesFromApplicationContext(message as [String: AnyObject])