Log full cached response headers at Trace log level for debugging caching

This commit is contained in:
Blake Watters
2012-09-09 20:02:29 -04:00
parent e5aed512a7
commit 0c3f5fbc57

View File

@@ -147,7 +147,7 @@ static inline NSString * RKDescriptionForRequest(NSURLRequest *request)
// Verify that the entry is valid
NSHTTPURLResponse *response = (NSHTTPURLResponse *) [cachedResponse response];
NSDate *cacheExpirationDate = RKHTTPCacheExpirationDateFromHeadersWithStatusCode([response allHeaderFields], response.statusCode);
RKLogDebug(@"Found cached response for request %@ with expiration date: %@", RKDescriptionForRequest(self.request), cacheExpirationDate);
RKLogTrace(@"Found cached response for request %@ with expiration date: %@ (cachedResponse.headers=%@)", RKDescriptionForRequest(self.request), cacheExpirationDate, [response allHeaderFields]);
if ([(NSDate *)[NSDate date] compare:cacheExpirationDate] == NSOrderedAscending) {
return cachedResponse;
}