Permalink
Browse files

logging changes

  • Loading branch information...
1 parent cc9884e commit 38bfc0f78611af67c47f8166194164415d725368 @neilrahilly neilrahilly committed Oct 24, 2012
Showing with 8 additions and 7 deletions.
  1. +4 −3 HelloMixpanel/HelloMixpanel/AppDelegate.m
  2. +4 −4 Mixpanel/Mixpanel.m
@@ -109,27 +109,28 @@ - (void)applicationDidEnterBackground:(UIApplication *)application
{
self.bgTask = [application beginBackgroundTaskWithExpirationHandler:^{
- NSLog(@"%@ background task cut short", self);
+ NSLog(@"%@ background task %u cut short", self, self.bgTask);
[application endBackgroundTask:self.bgTask];
self.bgTask = UIBackgroundTaskInvalid;
}];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
- NSLog(@"%@ background task starting", self);
+ NSLog(@"%@ starting background task %u", self, self.bgTask);
// track some events and set some people properties
Mixpanel *mixpanel = [Mixpanel sharedInstance];
[mixpanel registerSuperProperties:[NSDictionary dictionaryWithObject:@"Hi!" forKey:@"Background Super Property"]];
[mixpanel track:@"Background Event"];
[mixpanel.people set:@"Background Property" to:[NSDate date]];
+ NSLog(@"%@ ending background task %u", self, self.bgTask);
[application endBackgroundTask:self.bgTask];
self.bgTask = UIBackgroundTaskInvalid;
});
- NSLog(@"%@ background task dispatched", self);
+ NSLog(@"%@ dispatched background task %u", self, self.bgTask);
}
View
@@ -756,21 +756,21 @@ - (void)applicationDidEnterBackground:(NSNotificationCenter *)notification
[[UIApplication sharedApplication] respondsToSelector:@selector(endBackgroundTask:)]) {
self.taskId = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
- DevLog(@"%@ background flush cut short", self);
+ DevLog(@"%@ flush background task %u cut short", self, self.taskId);
[self cancelFlush];
[[UIApplication sharedApplication] endBackgroundTask:self.taskId];
self.taskId = UIBackgroundTaskInvalid;
}];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
- DevLog(@"%@ background flush starting", self);
+ DevLog(@"%@ starting flush background task %u", self, self.taskId);
[self flush];
- DevLog(@"%@ ending background flush with task id: %u", self, self.taskId);
+ DevLog(@"%@ ending flush background task %u", self, self.taskId);
[[UIApplication sharedApplication] endBackgroundTask:self.taskId];
self.taskId = UIBackgroundTaskInvalid;
});
- DevLog(@"%@ background flush dispatched with task id: %u", self, self.taskId);
+ DevLog(@"%@ dispatched flush background task %u", self, self.taskId);
}
#endif
}

0 comments on commit 38bfc0f

Please sign in to comment.