Rest Client: wrap log statement in logger.isDebugEnabled

This commit is contained in:
javanna 2016-07-08 12:51:48 +02:00 committed by Luca Cavanna
parent 02c98b11ab
commit c63719d085
1 changed files with 3 additions and 1 deletions

View File

@ -82,7 +82,9 @@ final class RequestLogger {
* Logs a request that failed
*/
static void logFailedRequest(Log logger, HttpUriRequest request, HttpHost host, IOException e) {
logger.debug("request [" + request.getMethod() + " " + host + getUri(request.getRequestLine()) + "] failed", e);
if (logger.isDebugEnabled()) {
logger.debug("request [" + request.getMethod() + " " + host + getUri(request.getRequestLine()) + "] failed", e);
}
if (logger.isTraceEnabled()) {
String traceRequest;
try {