in Sources/CrashReporter2/LogParser.swift [238:276]
func checkState(line: String) -> Bool {
if preState == .notStart {
return false
}
if line.hasPrefix("Exception Category:") ||
(line.hasPrefix("Thread ") && line.hasSuffix("Thread State:")) ||
line.hasPrefix("Binary Images:") ||
line.hasPrefix("Memory Status(bytes):") ||
line.hasPrefix("Storage Status(bytes):") ||
line.hasPrefix("Extra Information:") ||
line.hasPrefix("User Action: ") ||
line.hasPrefix("User Info: ") ||
line.hasPrefix("Custom Crash Info: ") {
preState = .notStart
return true
}
if line.hasPrefix("Thread ") && !line.hasSuffix("Thread State:") {
let shouldPack: Bool
if !inThreadListParsing {
inThreadListParsing = true
state = .blockStart
preState = .notStart
shouldPack = true
} else {
state = .blockInProgress
preState = .notStart
shouldPack = false
}
inStacktraceParsing = line.hasSuffix(" Crashed:")
return shouldPack
}
state = .blockInProgress
preState = .notStart
return false
}