IOS-1540 Tighter errorAndCrash. IOS-1540_GOOD
authorDirk Zimmermann <dz@pep.security>
Wed, 05 Jun 2019 16:12:20 +0200
branchIOS-1540_GOOD
changeset 8919bf6b5b50a651
parent 8918 fc82fe2a9896
child 8920 f8d91b944ceb
IOS-1540 Tighter errorAndCrash.
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,16 +164,15 @@
     1.4      public func errorAndCrash(function: String = #function,
     1.5                                filePath: String = #file,
     1.6                                fileLine: Int = #line,
     1.7 -                              _ message: StaticString,
     1.8 -                              _ args: CVarArg...) {
     1.9 -        saveLog(message: message,
    1.10 -                severity: .fault,
    1.11 -                function: function,
    1.12 -                filePath: filePath,
    1.13 -                fileLine: fileLine,
    1.14 -                args: args)
    1.15 +                              _ message: StaticString) {
    1.16 +        SystemUtils.crash("\(filePath):\(function):\(fileLine) - \(message)")
    1.17 +    }
    1.18  
    1.19 -        SystemUtils.crash("\(filePath):\(function):\(fileLine) - \(message)")
    1.20 +    public func errorAndCrash(function: String = #function,
    1.21 +                              filePath: String = #file,
    1.22 +                              fileLine: Int = #line,
    1.23 +                              _ error: Error) {
    1.24 +        SystemUtils.crash("\(filePath):\(function):\(fileLine) - \(error)")
    1.25      }
    1.26  
    1.27      /**