add more crash log

This commit is contained in:
yicheng 2018-12-01 21:44:49 +08:00
parent 4bc117c3e3
commit 157e0d2d34
1 changed files with 5 additions and 0 deletions

View File

@ -168,7 +168,12 @@ class AppDelegate: NSObject, NSApplicationDelegate {
print(exception) print(exception)
print(exception.callStackSymbols) print(exception.callStackSymbols)
let str = exception.callStackSymbols.joined(separator: "\n") let str = exception.callStackSymbols.joined(separator: "\n")
Logger.log(msg: "--------------CRASH--------------")
Logger.log(msg: exception.reason ?? "no reason", level: .error)
Logger.log(msg: str, level: .error) Logger.log(msg: str, level: .error)
Logger.log(msg: (String(describing: exception.userInfo)))
Logger.log(msg: "---------------------------------")
} }
NSSetUncaughtExceptionHandler(exceptionHandler) NSSetUncaughtExceptionHandler(exceptionHandler)
} }