IOS-1540 Better Logger.errorAndCrash. IOS-1540_GOOD
authorDirk Zimmermann <dz@pep.security>
Tue, 11 Jun 2019 16:28:31 +0200
branchIOS-1540_GOOD
changeset 902630c7f02bdc5f
parent 9025 52ece0de6d5d
child 9027 919fcd1cda19
IOS-1540 Better Logger.errorAndCrash.
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 @@ -165,30 +165,30 @@
     1.4                                filePath: String = #file,
     1.5                                fileLine: Int = #line,
     1.6                                error: Error) {
     1.7 -        os_log("%@:%d %@: %@",
     1.8 +        os_log("*** errorAndCrash: %@ (%@:%d %@)",
     1.9                 log: osLogger as! OSLog,
    1.10                 type: .fault,
    1.11 +               "\(error)",
    1.12                 filePath,
    1.13                 fileLine,
    1.14 -               function,
    1.15 -               "\(error)")
    1.16 +               function)
    1.17  
    1.18 -        SystemUtils.crash("\(filePath):\(fileLine) \(function): - \(error)")
    1.19 +        SystemUtils.crash("*** errorAndCrash: \(error) (\(filePath):\(fileLine) \(function))")
    1.20      }
    1.21  
    1.22      public func errorAndCrash(function: String = #function,
    1.23                                filePath: String = #file,
    1.24                                fileLine: Int = #line,
    1.25                                message: String) {
    1.26 -        os_log("%@:%d %@: %@",
    1.27 +        os_log("*** errorAndCrash: %@ (%@:%d %@)",
    1.28                 log: osLogger as! OSLog,
    1.29                 type: .fault,
    1.30 +               message,
    1.31                 filePath,
    1.32                 fileLine,
    1.33 -               function,
    1.34 -               "\(message)")
    1.35 +               function)
    1.36  
    1.37 -        SystemUtils.crash("\(filePath):\(fileLine) \(function): - \(message)")
    1.38 +        SystemUtils.crash("*** errorAndCrash: \(message) (\(filePath):\(fileLine) \(function))")
    1.39      }
    1.40  
    1.41      public func errorAndCrash(function: String = #function,
    1.42 @@ -203,7 +203,7 @@
    1.43                  fileLine: fileLine,
    1.44                  args: args)
    1.45  
    1.46 -        SystemUtils.crash("\(filePath):\(function):\(fileLine) - \(message)")
    1.47 +        SystemUtils.crash("*** errorAndCrash: \(message) (\(filePath):\(fileLine) \(function))")
    1.48      }
    1.49  
    1.50      /**