Skip to content

Commit

Permalink
Cleaned up custom crash dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
Erkan YILDIZ authored and Erkan YILDIZ committed Jun 10, 2015
1 parent d55dca7 commit f927531
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion Countly.h
Expand Up @@ -17,7 +17,6 @@
double lastTime;
BOOL isSuspended;
CountlyEventQueue *eventQueue;
NSDictionary* crashCustom;
}

+ (instancetype)sharedInstance;
Expand Down
16 changes: 8 additions & 8 deletions Countly.m
Expand Up @@ -854,6 +854,7 @@ - (void)dealloc
@interface Countly ()

@property (nonatomic, strong) NSMutableDictionary *messageInfos;
@property (nonatomic, strong) NSDictionary* crashCustom;

@end

Expand All @@ -876,7 +877,7 @@ - (instancetype)init
isSuspended = NO;
unsentSessionLength = 0;
eventQueue = [[CountlyEventQueue alloc] init];
crashCustom = NULL;
self.crashCustom = nil;

self.messageInfos = [NSMutableDictionary new];

Expand Down Expand Up @@ -1353,7 +1354,7 @@ - (void)startCrashReporting

- (void)startCrashReportingWithSegments:(NSDictionary *)segments
{
crashCustom = segments;
self.crashCustom = segments;
[self startCrashReporting];
}

Expand Down Expand Up @@ -1394,9 +1395,8 @@ void CountlyExceptionHandler(NSException *exception, bool nonfatal)
crashReport[@"_background"] = @(Countly.sharedInstance.isInBackground);
crashReport[@"_run"] = @(Countly.sharedInstance.timeSinceLaunch);

if(Countly.sharedInstance->crashCustom){
crashReport[@"_custom"] = Countly.sharedInstance->crashCustom;
}
if(Countly.sharedInstance.crashCustom)
crashReport[@"_custom"] = Countly.sharedInstance.crashCustom;

if(CountlyCustomCrashLogs)
crashReport[@"_logs"] = [CountlyCustomCrashLogs componentsJoinedByString:@"\n"];
Expand Down Expand Up @@ -1521,10 +1521,10 @@ - (NSInteger)batteryLevel
- (NSString*)orientation
{
NSArray *orientations = @[@"Unknown", @"Portrait", @"PortraitUpsideDown", @"LandscapeLeft", @"LandscapeRight", @"FaceUp", @"FaceDown"];
return [orientations objectAtIndex:UIDevice.currentDevice.orientation];
return orientations[UIDevice.currentDevice.orientation];
}

-(NSUInteger)connectionType
- (NSUInteger)connectionType
{
typedef enum:NSInteger {CLYConnectionNone, CLYConnectionCellNetwork, CLYConnectionWiFi} CLYConnectionType;
CLYConnectionType connType = CLYConnectionNone;
Expand Down Expand Up @@ -1581,7 +1581,7 @@ - (float)OpenGLESversion
return 1.0;
}

-(long)timeSinceLaunch
- (long)timeSinceLaunch
{
return time(NULL)-startTime;
}
Expand Down

0 comments on commit f927531

Please sign in to comment.