IOS-1540 Back out: Function errorAndCrash requiring StaticString. IOS-1540_GOOD
authorDirk Zimmermann <dz@pep.security>
Wed, 05 Jun 2019 16:12:20 +0200
branchIOS-1540_GOOD
changeset 8918fc82fe2a9896
parent 8917 2b64ca6005e4
child 8919 bf6b5b50a651
IOS-1540 Back out: Function errorAndCrash requiring StaticString.
Submodules/pEpIOSToolbox/pEpIOSToolbox/Other/Logger.swift
     1.1 --- a/Submodules/pEpIOSToolbox/pEpIOSToolbox/Other/Logger.swift	Wed Jun 05 16:12:20 2019 +0200
     1.2 +++ b/Submodules/pEpIOSToolbox/pEpIOSToolbox/Other/Logger.swift	Wed Jun 05 16:12:20 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      /**