Author: fschumacher
Date: Wed Jul 26 19:56:08 2017
New Revision: 1803103

URL: http://svn.apache.org/viewvc?rev=1803103&view=rev
Log:
Guard debug log messages that call a function with Logger#isDebugEnabled

Bugzilla Id: 61176

Modified:
    
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java

Modified: 
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java?rev=1803103&r1=1803102&r2=1803103&view=diff
==============================================================================
--- 
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
 (original)
+++ 
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
 Wed Jul 26 19:56:08 2017
@@ -498,8 +498,10 @@ public class CacheManager extends Config
 
     private CacheEntry getEntry(String url, Header[] headers) {
         CacheEntry entry = getCache().get(url);
-        log.debug("Cache: {}", getCache());
-        log.debug("inCache {} {} {}", url, entry, headers);
+        if (log.isDebugEnabled()) {
+            log.debug("Cache: {}", getCache());
+            log.debug("inCache {} {} {}", url, entry, headers);
+        }
         if (entry == null) {
             log.debug("No entry found for url {}", url);
             return null;
@@ -509,12 +511,16 @@ public class CacheManager extends Config
             return entry;
         }
         if (headers == null) {
-            log.debug("Entry {} found, but it should depend on vary {} for url 
{}", entry, entry.getVaryHeader(), url);
+            if (log.isDebugEnabled()) {
+                log.debug("Entry {} found, but it should depend on vary {} for 
url {}", entry, entry.getVaryHeader(), url);
+            }
             return null;
         }
         Pair<String, String> varyPair = getVaryHeader(entry.getVaryHeader(), 
headers);
         if (varyPair != null) {
-            log.debug("Looking again for {} because of {} with vary: {} ({})", 
url, entry, entry.getVaryHeader(), varyPair);
+            if (log.isDebugEnabled()) {
+                log.debug("Looking again for {} because of {} with vary: {} 
({})", url, entry, entry.getVaryHeader(), varyPair);
+            }
             return getEntry(varyUrl(url, entry.getVaryHeader(), 
varyPair.getRight()), null);
         }
         return null;


Reply via email to