@@ -75,7 +75,9 @@ static void (^reachabilityChangeBlock)(int);
75
75
[config.loggingFileHanlder writeData:[message dataUsingEncoding:NSUTF8StringEncoding]];
76
76
}
77
77
78
- NSLog(@"%@", message);
78
+ if ([[{ {classPrefix} }Configuration sharedConfig] debug]){
79
+ NSLog(@" %@" , message);
80
+ }
79
81
}
80
82
81
83
#pragma mark - Cache Methods
@@ -177,8 +179,9 @@ static void (^reachabilityChangeBlock)(int);
177
179
178
180
+(NSNumber*) queueRequest {
179
181
NSNumber* requestId = [{{classPrefix} }ApiClient nextRequestId];
180
- if([[{ {classPrefix} }Configuration sharedConfig] debug])
182
+ if([[{ {classPrefix} }Configuration sharedConfig] debug]) {
181
183
NSLog(@" added %@ to request queue" , requestId);
184
+ }
182
185
[queuedRequests addObject:requestId];
183
186
return requestId;
184
187
}
@@ -198,8 +201,9 @@ static void (^reachabilityChangeBlock)(int);
198
201
}];
199
202
200
203
if(matchingItems.count == 1) {
201
- if ([[{{classPrefix} }Configuration sharedConfig] debug])
204
+ if ([[{{classPrefix} }Configuration sharedConfig] debug]){
202
205
NSLog(@" removing request id %@" , requestId);
206
+ }
203
207
[queuedRequests removeObject:requestId];
204
208
return YES;
205
209
}
@@ -576,15 +580,21 @@ static void (^reachabilityChangeBlock)(int);
576
580
hasHeaderParams = true ;
577
581
}
578
582
if(offlineState) {
579
- NSLog(@" %@ cache forced" , resourcePath);
583
+ if ([[{{classPrefix} }Configuration sharedConfig] debug]){
584
+ NSLog(@" %@ cache forced" , resourcePath);
585
+ }
580
586
[request setCachePolicy:NSURLRequestReturnCacheDataDontLoad];
581
587
}
582
588
else if(!hasHeaderParams && [method isEqualToString:@"GET"] && cacheEnabled) {
583
- NSLog(@" %@ cache enabled" , resourcePath);
589
+ if ([[{{classPrefix} }Configuration sharedConfig] debug]){
590
+ NSLog(@" %@ cache enabled" , resourcePath);
591
+ }
584
592
[request setCachePolicy:NSURLRequestUseProtocolCachePolicy];
585
593
}
586
594
else {
587
- NSLog(@" %@ cache disabled" , resourcePath);
595
+ if ([[{{classPrefix} }Configuration sharedConfig] debug]){
596
+ NSLog(@" %@ cache disabled" , resourcePath);
597
+ }
588
598
[request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];
589
599
}
590
600
0 commit comments