IOS-1540 Not needed anymore: %{public}@. IOS-1540_GOOD
authorDirk Zimmermann <dz@pep.security>
Tue, 11 Jun 2019 16:28:31 +0200
branchIOS-1540_GOOD
changeset 9023d34edffe4f8d
parent 9022 2bbceb04230d
child 9024 b11f7271fd69
IOS-1540 Not needed anymore: %{public}@.
Submodules/pEpIOSToolbox/pEpIOSToolbox/Other/Logger.swift
pEpForiOS/AppDelegate.swift
pEpForiOS/UI/Handshake/HandshakeViewController.swift
pEpForiOS/UI/Handshake/ViewModel/HandshakePartnerTableViewCellViewModel.swift
pEpForiOS/UI/Login/LoginViewController.swift
pEpForiOS/UI/Login/ViewModel/LoginViewModel.swift
pEpForiOS/UI/Settings/Setting/AccountSettings/AccountSettingsTableViewController.swift
pEpForiOS/Util/Extensions/PEP_rating+Extension.swift
pEpForiOS/Util/UserNotificationTool.swift
subModules/pEpIOSToolbox/pEpIOSToolbox/Foundation/Data+Extensions.swift
subModules/pEpIOSToolbox/pEpIOSToolbox/Foundation/String+Extensions.swift
     1.1 --- a/Submodules/pEpIOSToolbox/pEpIOSToolbox/Other/Logger.swift	Tue Jun 11 16:28:31 2019 +0200
     1.2 +++ b/Submodules/pEpIOSToolbox/pEpIOSToolbox/Other/Logger.swift	Tue Jun 11 16:28:31 2019 +0200
     1.3 @@ -165,7 +165,7 @@
     1.4                                filePath: String = #file,
     1.5                                fileLine: Int = #line,
     1.6                                error: Error) {
     1.7 -        os_log("%{public}@:%d %{public}@: %{public}@",
     1.8 +        os_log("%@:%d %@: %@",
     1.9                 log: osLogger as! OSLog,
    1.10                 type: .fault,
    1.11                 filePath,
    1.12 @@ -180,7 +180,7 @@
    1.13                                filePath: String = #file,
    1.14                                fileLine: Int = #line,
    1.15                                message: String) {
    1.16 -        os_log("%{public}@:%d %{public}@: %{public}@",
    1.17 +        os_log("%@:%d %@: %@",
    1.18                 log: osLogger as! OSLog,
    1.19                 type: .fault,
    1.20                 filePath,
    1.21 @@ -221,7 +221,7 @@
    1.22          // So we wrap it into an NSError which does suppord CVArg.
    1.23          let nsErr = NSError(domain: subsystem, code: 0, userInfo: [NSUnderlyingErrorKey: error])
    1.24  
    1.25 -        saveLog(message: "%{public}@",
    1.26 +        saveLog(message: "%@",
    1.27                  severity: .default,
    1.28                  function: function,
    1.29                  filePath: filePath,
    1.30 @@ -283,10 +283,9 @@
    1.31              let theLog = osLogger as! OSLog
    1.32              let theType = severity.osLogType()
    1.33  
    1.34 -            let formatString = "\(message)".replacingOccurrences(of: "%{public}", with: "%")
    1.35 -            let ourString = String(format: formatString, arguments: args)
    1.36 +            let ourString = String(format: "\(message)", arguments: args)
    1.37  
    1.38 -            os_log("%{public}@:%d %{public}@: %{public}@",
    1.39 +            os_log("%@:%d %@: %@",
    1.40                     log: theLog,
    1.41                     type: theType,
    1.42                     filePath,
     2.1 --- a/pEpForiOS/AppDelegate.swift	Tue Jun 11 16:28:31 2019 +0200
     2.2 +++ b/pEpForiOS/AppDelegate.swift	Tue Jun 11 16:28:31 2019 +0200
     2.3 @@ -88,7 +88,7 @@
     2.4          syncUserActionsAndCleanupbackgroundTaskId =
     2.5              application.beginBackgroundTask(expirationHandler: { [unowned self] in
     2.6                  Log.shared.errorAndCrash(
     2.7 -                    "syncUserActionsAndCleanupbackgroundTask with ID %{public}@ expired",
     2.8 +                    "syncUserActionsAndCleanupbackgroundTask with ID %@ expired",
     2.9                      self.syncUserActionsAndCleanupbackgroundTaskId as CVarArg)
    2.10                  // We migh want to call some (yet unexisting) emergency shutdown on
    2.11                  // ReplicationService here that brutally shuts down everything.
    2.12 @@ -254,7 +254,7 @@
    2.13          let pEpReInitialized = deleteManagementDBIfRequired()
    2.14  
    2.15          setupServices()
    2.16 -        Log.shared.log("Library url: %{public}@", String(describing: applicationDirectory()))
    2.17 +        Log.shared.log("Library url: %@", String(describing: applicationDirectory()))
    2.18          deleteAllFolders(pEpReInitialized: pEpReInitialized)
    2.19  
    2.20          askUserForPermissions()
     3.1 --- a/pEpForiOS/UI/Handshake/HandshakeViewController.swift	Tue Jun 11 16:28:31 2019 +0200
     3.2 +++ b/pEpForiOS/UI/Handshake/HandshakeViewController.swift	Tue Jun 11 16:28:31 2019 +0200
     3.3 @@ -268,7 +268,7 @@
     3.4          do {
     3.5              languages = try theSession.languageList()
     3.6          } catch let err as NSError {
     3.7 -            Log.shared.error("%{public}@", err.localizedDescription)
     3.8 +            Log.shared.error("%@", err.localizedDescription)
     3.9              languages = []
    3.10          }
    3.11  
    3.12 @@ -321,7 +321,7 @@
    3.13          do {
    3.14              destination.languages = try theSession.languageList()
    3.15          } catch let err as NSError {
    3.16 -            Log.shared.error("%{public}@", err.localizedDescription)
    3.17 +            Log.shared.error("%@", err.localizedDescription)
    3.18              destination.languages = []
    3.19          }
    3.20      }
     4.1 --- a/pEpForiOS/UI/Handshake/ViewModel/HandshakePartnerTableViewCellViewModel.swift	Tue Jun 11 16:28:31 2019 +0200
     4.2 +++ b/pEpForiOS/UI/Handshake/ViewModel/HandshakePartnerTableViewCellViewModel.swift	Tue Jun 11 16:28:31 2019 +0200
     4.3 @@ -108,7 +108,7 @@
     4.4          do {
     4.5              isPartnerpEpUser = try session.isPEPUser(pEpPartner).boolValue
     4.6          } catch let err as NSError {
     4.7 -            Log.shared.error("%{public}@", err.localizedDescription)
     4.8 +            Log.shared.error("%@", err.localizedDescription)
     4.9              isPartnerpEpUser = false
    4.10          }
    4.11          setPartnerImage(for: partner)
    4.12 @@ -159,7 +159,7 @@
    4.13                  language: trustwordsLanguage,
    4.14                  full: trustwordsFull)
    4.15          } catch let err as NSError {
    4.16 -            Log.shared.error("%{public}@", err.localizedDescription)
    4.17 +            Log.shared.error("%@", err.localizedDescription)
    4.18              return nil
    4.19          }
    4.20      }
     5.1 --- a/pEpForiOS/UI/Login/LoginViewController.swift	Tue Jun 11 16:28:31 2019 +0200
     5.2 +++ b/pEpForiOS/UI/Login/LoginViewController.swift	Tue Jun 11 16:28:31 2019 +0200
     5.3 @@ -156,7 +156,7 @@
     5.4      }
     5.5  
     5.6      private func handleLoginError(error: Error, offerManualSetup: Bool) {
     5.7 -        Log.shared.error("%{public}@", error.localizedDescription)
     5.8 +        Log.shared.error("%@", error.localizedDescription)
     5.9          self.isCurrentlyVerifying = false
    5.10          guard let error = DisplayUserError(withError: error) else {
    5.11              // Do nothing. The error type is not suitable to bother the user with.
     6.1 --- a/pEpForiOS/UI/Login/ViewModel/LoginViewModel.swift	Tue Jun 11 16:28:31 2019 +0200
     6.2 +++ b/pEpForiOS/UI/Login/ViewModel/LoginViewModel.swift	Tue Jun 11 16:28:31 2019 +0200
     6.3 @@ -101,7 +101,7 @@
     6.4  
     6.5          func statusOk() {
     6.6              if let error = AccountSettings.AccountSettingsError(accountSettings: acSettings) {
     6.7 -                Log.shared.error("%{public}@", error.localizedDescription)
     6.8 +                Log.shared.error("%@", error.localizedDescription)
     6.9                  loginViewModelLoginErrorDelegate?.handle(loginError: error)
    6.10                  return
    6.11              }
    6.12 @@ -165,7 +165,7 @@
    6.13          do {
    6.14              try theVerificationService.verify()
    6.15          } catch {
    6.16 -            Log.shared.error("%{public}@", error.localizedDescription)
    6.17 +            Log.shared.error("%@", error.localizedDescription)
    6.18              loginViewModelLoginErrorDelegate?.handle(loginError: error)
    6.19          }
    6.20      }
     7.1 --- a/pEpForiOS/UI/Settings/Setting/AccountSettings/AccountSettingsTableViewController.swift	Tue Jun 11 16:28:31 2019 +0200
     7.2 +++ b/pEpForiOS/UI/Settings/Setting/AccountSettings/AccountSettingsTableViewController.swift	Tue Jun 11 16:28:31 2019 +0200
     7.3 @@ -303,7 +303,7 @@
     7.4  
     7.5  extension AccountSettingsTableViewController {
     7.6      public func handleLoginError(error: Error) {
     7.7 -        Log.shared.error("%{public}@", error.localizedDescription)
     7.8 +        Log.shared.error("%@", error.localizedDescription)
     7.9          UIUtils.show(error: error, inViewController: self)
    7.10      }
    7.11  }
     8.1 --- a/pEpForiOS/Util/Extensions/PEP_rating+Extension.swift	Tue Jun 11 16:28:31 2019 +0200
     8.2 +++ b/pEpForiOS/Util/Extensions/PEP_rating+Extension.swift	Tue Jun 11 16:28:31 2019 +0200
     8.3 @@ -32,7 +32,7 @@
     8.4              return false
     8.5          default:
     8.6              Log.shared.errorAndCrash(
     8.7 -                "cannot decide isUnderAttack() for %{public}@", self.rawValue)
     8.8 +                "cannot decide isUnderAttack() for %@", self.rawValue)
     8.9              return false
    8.10          }
    8.11      }
    8.12 @@ -58,7 +58,7 @@
    8.13              return false
    8.14          default:
    8.15              Log.shared.errorAndCrash(
    8.16 -                "cannot decide isUnderAttack() for %{public}@", self.rawValue)
    8.17 +                "cannot decide isUnderAttack() for %@", self.rawValue)
    8.18              return false
    8.19          }
    8.20      }
     9.1 --- a/pEpForiOS/Util/UserNotificationTool.swift	Tue Jun 11 16:28:31 2019 +0200
     9.2 +++ b/pEpForiOS/Util/UserNotificationTool.swift	Tue Jun 11 16:28:31 2019 +0200
     9.3 @@ -65,7 +65,7 @@
     9.4              center.add(request) { (error) in
     9.5                  if let error = error {
     9.6                      Log.shared.warn(
     9.7 -                        "Error posting user notification: %{public}@",
     9.8 +                        "Error posting user notification: %@",
     9.9                          error.localizedDescription)
    9.10                  }
    9.11              }
    10.1 --- a/subModules/pEpIOSToolbox/pEpIOSToolbox/Foundation/Data+Extensions.swift	Tue Jun 11 16:28:31 2019 +0200
    10.2 +++ b/subModules/pEpIOSToolbox/pEpIOSToolbox/Foundation/Data+Extensions.swift	Tue Jun 11 16:28:31 2019 +0200
    10.3 @@ -30,7 +30,7 @@
    10.4          do {
    10.5              try write(to: url)
    10.6          } catch {
    10.7 -            Log.shared.error("Could not save to %{public}@", url.absoluteString)
    10.8 +            Log.shared.error("Could not save to %@", url.absoluteString)
    10.9          }
   10.10      }
   10.11  
   10.12 @@ -40,7 +40,7 @@
   10.13                  withJSONObject: self, options: .prettyPrinted)
   10.14              jsonData.debugSave(basePath: basePath, fileName: fileName, ext: ext)
   10.15          } catch let err {
   10.16 -            Log.shared.error("%{public}@", err.localizedDescription)
   10.17 +            Log.shared.error("%@", err.localizedDescription)
   10.18          }
   10.19      }
   10.20  }
    11.1 --- a/subModules/pEpIOSToolbox/pEpIOSToolbox/Foundation/String+Extensions.swift	Tue Jun 11 16:28:31 2019 +0200
    11.2 +++ b/subModules/pEpIOSToolbox/pEpIOSToolbox/Foundation/String+Extensions.swift	Tue Jun 11 16:28:31 2019 +0200
    11.3 @@ -178,7 +178,7 @@
    11.4              let matches = regex.matches(in: self, options: [], range: wholeRange())
    11.5              return matches.count > 0
    11.6          } catch {
    11.7 -            Log.shared.errorAndCrash("%{public}@", error.localizedDescription)
    11.8 +            Log.shared.errorAndCrash("%@", error.localizedDescription)
    11.9          }
   11.10          return false
   11.11      }
   11.12 @@ -209,7 +209,7 @@
   11.13                  }
   11.14              }
   11.15          } catch {
   11.16 -            Log.shared.errorAndCrash("%{public}@",
   11.17 +            Log.shared.errorAndCrash("%@",
   11.18                                                          error.localizedDescription)
   11.19          }
   11.20          return self
   11.21 @@ -233,7 +233,7 @@
   11.22                  }
   11.23              }
   11.24          } catch {
   11.25 -            Log.shared.errorAndCrash("%{public}@",
   11.26 +            Log.shared.errorAndCrash("%@",
   11.27                                                          error.localizedDescription)
   11.28          }
   11.29          return self