@@ -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
}
@@ -577,15 +581,21 @@ static void (^reachabilityChangeBlock)(int);
577
581
hasHeaderParams = true ;
578
582
}
579
583
if(offlineState) {
580
- NSLog(@" %@ cache forced" , resourcePath);
584
+ if ([[{{classPrefix} }Configuration sharedConfig] debug]){
585
+ NSLog(@" %@ cache forced" , resourcePath);
586
+ }
581
587
[request setCachePolicy:NSURLRequestReturnCacheDataDontLoad];
582
588
}
583
589
else if(!hasHeaderParams && [method isEqualToString:@"GET"] && cacheEnabled) {
584
- NSLog(@" %@ cache enabled" , resourcePath);
590
+ if ([[{{classPrefix} }Configuration sharedConfig] debug]){
591
+ NSLog(@" %@ cache enabled" , resourcePath);
592
+ }
585
593
[request setCachePolicy:NSURLRequestUseProtocolCachePolicy];
586
594
}
587
595
else {
588
- NSLog(@" %@ cache disabled" , resourcePath);
596
+ if ([[{{classPrefix} }Configuration sharedConfig] debug]){
597
+ NSLog(@" %@ cache disabled" , resourcePath);
598
+ }
589
599
[request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];
590
600
}
591
601
0 commit comments