Skip to content

Commit

Permalink
Remove log spew from the device screen
Browse files Browse the repository at this point in the history
Now that the sync has been working reliably for a couple of days, reduce log
spew on the actual device so that users are not ticked off.
  • Loading branch information
shankari committed Mar 4, 2016
1 parent 99da79b commit b9d8fbc
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/ios/BEMServerSyncCommunicationHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ + (BFTask*) pushAndClearUserCache {
* We need to test this more carefully when we switch to the visit-based tracking.
*/
[LocalNotificationManager addNotification:[NSString stringWithFormat:
@"pushAndClearUserCache called"] showUI:TRUE];
@"pushAndClearUserCache called"] showUI:FALSE];
NSArray* locEntriesToPush = [[BuiltinUserCache database] syncPhoneToServer];
if ([locEntriesToPush count] == 0) {
[LocalNotificationManager addNotification:[NSString stringWithFormat:
@"locEntriesToPush count == 0, returning "] showUI:TRUE];
@"locEntriesToPush count == 0, returning "] showUI:FALSE];
return [BFTask taskWithResult:@(TRUE)];
}

Expand All @@ -76,8 +76,7 @@ + (void) pushAndClearCombinedData:(NSArray*)entriesToPush timeQuery:(TimeQuery*)
task:(BFTaskCompletionSource*)task {
if (entriesToPush.count == 0) {
[LocalNotificationManager addNotification:[NSString stringWithFormat:
@"No data to send, returning early"] showUI:TRUE];
NSLog(@"No data to send, returning early");
@"No data to send, returning early"] showUI:FALSE];
} else {
[self phone_to_server:entriesToPush
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
Expand All @@ -92,7 +91,6 @@ + (void) pushAndClearCombinedData:(NSArray*)entriesToPush timeQuery:(TimeQuery*)
[LocalNotificationManager addNotification:[NSString stringWithFormat:
@"Got error %@ while pushing changes to server, retaining data", error] showUI:TRUE];
}
NSLog(@"Returning from silent push");
[task setResult:@(TRUE)];
}];
}
Expand All @@ -117,21 +115,21 @@ +(BFTask*) pullIntoUserCache {
* by the user, or as part of background sync.
*/
[LocalNotificationManager addNotification:[NSString stringWithFormat:
@"pullIntoUserCache called"] showUI:TRUE];
@"pullIntoUserCache called"] showUI:FALSE];
BFTaskCompletionSource *task = [BFTaskCompletionSource taskCompletionSource];
ClientStatsDatabase* statsDb = [ClientStatsDatabase database];
NSString* currTS = [ClientStatsDatabase getCurrentTimeMillisString];
NSString* batteryLevel = [@([UIDevice currentDevice].batteryLevel) stringValue];
[statsDb storeMeasurement:@"battery_level" value:batteryLevel ts:currTS];

[LocalNotificationManager addNotification:[NSString stringWithFormat:
@"about to launch remote call for server_to_phone"] showUI:TRUE];
@"about to launch remote call for server_to_phone"] showUI:FALSE];
long msTimeStart = [ClientStatsDatabase getCurrentTimeMillis];

// Called in order to download data in the background
[self server_to_phone:^(NSData *data, NSURLResponse *response, NSError *error) {
[LocalNotificationManager addNotification:[NSString stringWithFormat:
@"received response for server_to_phone"] showUI:TRUE];
@"received response for server_to_phone"] showUI:FALSE];

if (error != NULL) {
[LocalNotificationManager addNotification:[NSString stringWithFormat:
Expand All @@ -151,7 +149,7 @@ +(BFTask*) pullIntoUserCache {
[task setResult:@(TRUE)];
} else {
[LocalNotificationManager addNotification:[NSString stringWithFormat:
@"Got non NULL data while retrieving data"] showUI:TRUE];
@"Got non NULL data while retrieving data"] showUI:FALSE];
NSInteger newSectionCount = [self fetchedData:data];
[LocalNotificationManager addNotification:[NSString stringWithFormat:
@"Retrieved %@ documents", @(newSectionCount)] showUI:TRUE];
Expand Down

0 comments on commit b9d8fbc

Please sign in to comment.