Skip to content

Commit

Permalink
Merge b903782 into 0dfd5fd
Browse files Browse the repository at this point in the history
  • Loading branch information
israelcolomer committed Apr 24, 2017
2 parents 0dfd5fd + b903782 commit 257deb4
Showing 1 changed file with 6 additions and 6 deletions.
Expand Up @@ -91,7 +91,7 @@ public Observable<Response> request(
HttpUriRequest request = buildHttpRequest(method, targetURI);
setRequestOptions(request, options);
setRequestHeaders(request, headers);
printRequestIfDebugging(method, targetURI, headers);
printRequestIfTracingLog(method, targetURI, headers);

CloseableHttpResponse httpResponse;
if (body != null) {
Expand Down Expand Up @@ -156,13 +156,13 @@ protected CloseableHttpResponse doExecute(CloseableHttpClient httpClient, HttpUr
return httpClient.execute(request);
}

private void printRequestIfDebugging(Method method, URI composedUri, Multimap<String, String> headers) {
if (logger.isDebugEnabled()) {
logger.debug("Making HTTP request {} {}", method.name(), composedUri);
private void printRequestIfTracingLog(Method method, URI composedUri, Multimap<String, String> headers) {
if (logger.isTraceEnabled()) {
logger.trace("Making HTTP request {} {}", method.name(), composedUri);
if (headers != null && logger.isDebugEnabled()) {
logger.debug(" HTTP request headers:");
logger.trace(" HTTP request headers:");
for (Map.Entry<String, String> header : headers.entries()) {
logger.debug(" {}: {}", header.getKey(), header.getValue());
logger.trace(" {}: {}", header.getKey(), header.getValue());
}
}
}
Expand Down

0 comments on commit 257deb4

Please sign in to comment.