Skip to content

Commit

Permalink
Drop OS-specific log targeting for SFBCrashReporter.
Browse files Browse the repository at this point in the history
Since we're targeting OS X 10.8+, we don't need to
accommodate Leopard-.
  • Loading branch information
Shadowfiend committed Aug 30, 2013
1 parent 0bc4cb2 commit 92ed45e
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions app/SFBCrashReporter.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,31 +53,8 @@ @implementation SFBCrashReporter (Private)

+ (NSArray *) crashLogDirectories
{
// Determine which directories contain crash logs based on the OS version
// See http://developer.apple.com/technotes/tn2004/tn2123.html

// Determine the OS version
SInt32 versionMajor = 0;
OSErr err = Gestalt(gestaltSystemVersionMajor, &versionMajor);
if(noErr != err)
NSLog(@"SFBCrashReporter: Unable to determine major system version (%i)", err);

SInt32 versionMinor = 0;
err = Gestalt(gestaltSystemVersionMinor, &versionMinor);
if(noErr != err)
NSLog(@"SFBCrashReporter: Unable to determine minor system version (%i)", err);

NSArray *libraryPaths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask | NSLocalDomainMask, YES);
NSString *crashLogDirectory = nil;

// Snow Leopard (10.6) or later
// Snow Leopard crash logs are located in ~/Library/Logs/DiagnosticReports with aliases placed in the Leopard location
if(10 == versionMajor && 6 <= versionMinor)
crashLogDirectory = @"Logs/DiagnosticReports";
// Leopard (10.5) or earlier
// Leopard crash logs have the form APPNAME_YYYY-MM-DD-hhmm_MACHINE.crash and are located in ~/Library/Logs/CrashReporter
else if(10 == versionMajor && 5 >= versionMinor)
crashLogDirectory = @"Logs/CrashReporter";
NSString *crashLogDirectory = @"Logs/DiagnosticReports";

NSMutableArray *crashFolderPaths = [[NSMutableArray alloc] init];

Expand Down

0 comments on commit 92ed45e

Please sign in to comment.