IOS-1540 Back out f1d7837d58b6: Function errorAndCrash requiring StaticString. IOS-1540_GOOD
authorDirk Zimmermann <dz@pep.security>
Tue, 11 Jun 2019 16:28:31 +0200
branchIOS-1540_GOOD
changeset 90139701654574df
parent 9012 2351c0bde73b
child 9014 b6e5205bc054
IOS-1540 Back out f1d7837d58b6: Function errorAndCrash requiring StaticString.
Submodules/pEpIOSToolbox/pEpIOSToolbox/Other/Logger.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 @@ -164,10 +164,16 @@
     1.4      public func errorAndCrash(function: String = #function,
     1.5                                filePath: String = #file,
     1.6                                fileLine: Int = #line,
     1.7 -                              _ message: StaticString) {
     1.8 -        let msgString = "\(message)"
     1.9 -        os_log("%{public}@ %{public}@ (%{public}@):%d", msgString, function, filePath, fileLine)
    1.10 -        SystemUtils.crash(msgString)
    1.11 +                              _ message: StaticString,
    1.12 +                              _ args: CVarArg...) {
    1.13 +        saveLog(message: message,
    1.14 +                severity: .fault,
    1.15 +                function: function,
    1.16 +                filePath: filePath,
    1.17 +                fileLine: fileLine,
    1.18 +                args: args)
    1.19 +
    1.20 +        SystemUtils.crash("\(filePath):\(function):\(fileLine) - \(message)")
    1.21      }
    1.22  
    1.23      /**