Adding Level to Exception

You can set different levels for manually reported exceptions using the following API:

let exception = NSException(name: NSExceptionName("some_exception"), reason: "Exception reason")
if let nonFatalException = CrashReporting.exception(exception) {
    nonFatalException.level = .critical
    nonFatalException.report()
}

Here are the different severity levels available. In case no level is indicated, the default level would be ERROR.

.warning
.error
.critical
.info

Last updated