You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@AvdLee I think that the MXCrashDiagnostic's loggable representation would be much more meaningful if the exception type, code, and signal were converted from their integer form to human readable type.
This is how Apple represents them in crash files so it would align with system design and system generated crash reports.
Technically we know that the int32Value's will not be nil from the documentation, but they're an NSNumber so doing some 'guarantee' nil checking is necessary for robustness.
extension String.StringInterpolation {
mutating func appendInterpolation(signal: Int32?) {
guard let signal else {
appendLiteral("")
return
}
let literal: String
switch signal {
case SIGKILL:
literal = "SIGKILL"
case SIGTERM:
literal = "SIGTERM"
default:
// TODO: All other signals defined in usr/include/sys/signal.h
literal = "\(signal)"
}
self.appendLiteral(literal)
}
mutating func appendInterpolation(exceptionType: Int32?) {
guard let exceptionType else {
appendLiteral("")
return
}
let literal: String
switch exceptionType {
case EXC_BAD_ACCESS:
literal = "EXC_BAD_ACCESS"
case EXC_BAD_INSTRUCTION:
literal = "EXC_BAD_INSTRUCTION"
default:
// TODO: All other exception types defined in usr/include/mach/exception_types.h
literal = "\(exceptionType)"
}
appendLiteral(literal)
}
mutating func appendInterpolation(exceptionCode: Int32?) {
// TODO: Implement detection of code per exception type referencing usr/include/mach/exception_types.h
}
}
The text was updated successfully, but these errors were encountered:
@AvdLee I think that the MXCrashDiagnostic's loggable representation would be much more meaningful if the exception type, code, and signal were converted from their integer form to human readable type.
This is how Apple represents them in crash files so it would align with system design and system generated crash reports.
References:
https://developer.apple.com/documentation/xcode/examining-the-fields-in-a-crash-report#Exception-information
https://developer.apple.com/documentation/xcode/understanding-the-exception-types-in-a-crash-report
I plan to do this in my fork and would be happy to contribute a PR for this if you feel it fits the intent of the metric kit loggable representations.
Technically we know that the int32Value's will not be nil from the documentation, but they're an NSNumber so doing some 'guarantee' nil checking is necessary for robustness.
The text was updated successfully, but these errors were encountered: