Add additional logging in crash processing flow

This commit is contained in:
Lukas Spieß
2016-07-07 17:14:00 +02:00
parent 520e959e88
commit b647a586d3

View File

@@ -737,6 +737,7 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf
* @param filename the crash reports temp filename
*/
- (void)storeMetaDataForCrashReportFilename:(NSString *)filename {
BITHockeyLog(@"VERBOSE: Storing meta data for crash report with filename %@", filename);
NSError *error = NULL;
NSMutableDictionary *metaDict = [NSMutableDictionary dictionaryWithCapacity:4];
NSString *applicationLog = @"";
@@ -751,6 +752,7 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf
[metaDict setObject:applicationLog forKey:kBITCrashMetaApplicationLog];
if ([self.delegate respondsToSelector:@selector(attachmentForCrashManager:)]) {
BITHockeyLog(@"VERBOSE: Processing attachment for crash report with filename %@", filename);
BITHockeyAttachment *attachment = [self.delegate attachmentForCrashManager:self];
if (attachment && attachment.hockeyAttachmentData) {
@@ -765,8 +767,9 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf
if (plist) {
[plist writeToFile:[_crashesDir stringByAppendingPathComponent: [filename stringByAppendingPathExtension:@"meta"]] atomically:YES];
} else {
BITHockeyLog(@"ERROR: Writing crash meta data failed. %@", error);
BITHockeyLog(@"ERROR: Serializing metaDict failed. %@", error);
}
BITHockeyLog(@"VERBOSE: Storing crash meta data finished.");
}
- (BOOL)handleUserInput:(BITCrashManagerUserInput)userInput withUserProvidedMetaData:(BITCrashMetaData *)userProvidedMetaData {
@@ -817,6 +820,7 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf
* Parse the new crash report and gather additional meta data from the app which will be stored along the crash report
*/
- (void) handleCrashReport {
BITHockeyLog(@"VERBOSE: Handling crash report");
NSError *error = NULL;
if (!self.plCrashReporter) return;
@@ -825,6 +829,7 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf
if (![_fileManager fileExistsAtPath:_analyzerInProgressFile]) {
// mark the start of the routine
[_fileManager createFileAtPath:_analyzerInProgressFile contents:nil attributes:nil];
BITHockeyLog(@"VERBOSE: AnalyzerInProgress file created");
[self saveSettings];
@@ -880,6 +885,8 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf
[self storeMetaDataForCrashReportFilename:cacheFilename];
}
}
} else {
BITHockeyLog(@"WARNING: AnalyzerInProgress file found, handling crash report skipped");
}
// Purge the report
@@ -968,6 +975,7 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf
}
- (void)triggerDelayedProcessing {
BITHockeyLog(@"VERBOE: Triggering delayed crash processing.");
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(invokeDelayedProcessing) object:nil];
[self performSelector:@selector(invokeDelayedProcessing) withObject:nil afterDelay:0.5];
}
@@ -1222,6 +1230,7 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf
}
if (considerReport) {
BITHockeyLog(@"INFO: App kill detected, creating crash report.");
[self createCrashReportForAppKill];
_didCrashInLastSession = YES;
@@ -1241,6 +1250,7 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf
[[NSUserDefaults standardUserDefaults] synchronize];
[self triggerDelayedProcessing];
BITHockeyLog(@"VERBOSE: CrashManager startManager has finished.");
}
/**