jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1853271 - in /jmeter/trunk/src/functions/org/apache/jmeter/functions: BeanShell.java CharFunction.java EscapeOroRegexpChars.java JavaScript.java RandomString.java RegexFunction.java SplitFunction.java
Date Sat, 09 Feb 2019 13:13:47 GMT
Author: fschumacher
Date: Sat Feb  9 13:13:47 2019
New Revision: 1853271

URL: http://svn.apache.org/viewvc?rev=1853271&view=rev
Log:
Use log string formatting.

Modified:
    jmeter/trunk/src/functions/org/apache/jmeter/functions/BeanShell.java
    jmeter/trunk/src/functions/org/apache/jmeter/functions/CharFunction.java
    jmeter/trunk/src/functions/org/apache/jmeter/functions/EscapeOroRegexpChars.java
    jmeter/trunk/src/functions/org/apache/jmeter/functions/JavaScript.java
    jmeter/trunk/src/functions/org/apache/jmeter/functions/RandomString.java
    jmeter/trunk/src/functions/org/apache/jmeter/functions/RegexFunction.java
    jmeter/trunk/src/functions/org/apache/jmeter/functions/SplitFunction.java

Modified: jmeter/trunk/src/functions/org/apache/jmeter/functions/BeanShell.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/functions/org/apache/jmeter/functions/BeanShell.java?rev=1853271&r1=1853270&r2=1853271&view=diff
==============================================================================
--- jmeter/trunk/src/functions/org/apache/jmeter/functions/BeanShell.java (original)
+++ jmeter/trunk/src/functions/org/apache/jmeter/functions/BeanShell.java Sat Feb  9 13:13:47
2019
@@ -108,9 +108,7 @@ public class BeanShell extends AbstractF
         {
             log.warn("Error running BSH script", ex);
         }
-        if(log.isDebugEnabled()) {
-            log.debug("__Beanshell("+script+","+varName+")=" + resultStr);
-        }
+        log.debug("__Beanshell({},{})={}", script, varName, resultStr);
         return resultStr;
 
     }

Modified: jmeter/trunk/src/functions/org/apache/jmeter/functions/CharFunction.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/functions/org/apache/jmeter/functions/CharFunction.java?rev=1853271&r1=1853270&r2=1853271&view=diff
==============================================================================
--- jmeter/trunk/src/functions/org/apache/jmeter/functions/CharFunction.java (original)
+++ jmeter/trunk/src/functions/org/apache/jmeter/functions/CharFunction.java Sat Feb  9 13:13:47
2019
@@ -63,7 +63,7 @@ public class CharFunction extends Abstra
                 char ch = (char) value;
                 sb.append(ch);
             } catch (NumberFormatException e) {
-                log.warn("Could not parse " + numberString + " : " + e);
+                log.warn("Could not parse {} : {}", numberString, e.toString());
             }
         }
         return sb.toString();

Modified: jmeter/trunk/src/functions/org/apache/jmeter/functions/EscapeOroRegexpChars.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/functions/org/apache/jmeter/functions/EscapeOroRegexpChars.java?rev=1853271&r1=1853270&r2=1853271&view=diff
==============================================================================
--- jmeter/trunk/src/functions/org/apache/jmeter/functions/EscapeOroRegexpChars.java (original)
+++ jmeter/trunk/src/functions/org/apache/jmeter/functions/EscapeOroRegexpChars.java Sat Feb
 9 13:13:47 2019
@@ -84,9 +84,7 @@ public class EscapeOroRegexpChars extend
         }
 
         if (log.isDebugEnabled()) {
-            String tn = Thread.currentThread().getName();
-            log.debug(tn + " name:" //$NON-NLS-1$
-                    + varName + " value:" + escapedValue);//$NON-NLS-1$
+            log.debug("{} name:{} value:{}", Thread.currentThread().getName(), varName, escapedValue);
//$NON-NLS-1$
         }
 
         return escapedValue;

Modified: jmeter/trunk/src/functions/org/apache/jmeter/functions/JavaScript.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/functions/org/apache/jmeter/functions/JavaScript.java?rev=1853271&r1=1853270&r2=1853271&view=diff
==============================================================================
--- jmeter/trunk/src/functions/org/apache/jmeter/functions/JavaScript.java (original)
+++ jmeter/trunk/src/functions/org/apache/jmeter/functions/JavaScript.java Sat Feb  9 13:13:47
2019
@@ -145,7 +145,7 @@ public class JavaScript extends Abstract
                 vars.put(varName, resultStr);
             }
         } catch (Exception e) {
-            log.error("Error processing Javascript: [" + script + "]\n", e);
+            log.error("Error processing Javascript: [{}]", script, e);
             throw new InvalidVariableException("Error processing Javascript: [" + script
+ "]", e);
         } 
         return resultStr;
@@ -188,7 +188,7 @@ public class JavaScript extends Abstract
                 vars.put(varName, resultStr);
             }
         } catch (RhinoException e) {
-            log.error("Error processing Javascript: [" + script + "]\n", e);
+            log.error("Error processing Javascript: [{}]", script, e);
             throw new InvalidVariableException("Error processing Javascript: [" + script
+ "]", e);
         } finally {
             Context.exit();

Modified: jmeter/trunk/src/functions/org/apache/jmeter/functions/RandomString.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/functions/org/apache/jmeter/functions/RandomString.java?rev=1853271&r1=1853270&r2=1853271&view=diff
==============================================================================
--- jmeter/trunk/src/functions/org/apache/jmeter/functions/RandomString.java (original)
+++ jmeter/trunk/src/functions/org/apache/jmeter/functions/RandomString.java Sat Feb  9 13:13:47
2019
@@ -102,9 +102,7 @@ public class RandomString extends Abstra
         }
 
         if (log.isDebugEnabled()) {
-            String tn = Thread.currentThread().getName();
-            log.debug(tn + " name:" //$NON-NLS-1$
-                    + myName + " value:" + myValue);//$NON-NLS-1$
+            log.debug("{} name:{} value:{}", Thread.currentThread().getName(), myName, myValue);
//$NON-NLS-1$
         }
 
         return myValue;

Modified: jmeter/trunk/src/functions/org/apache/jmeter/functions/RegexFunction.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/functions/org/apache/jmeter/functions/RegexFunction.java?rev=1853271&r1=1853270&r2=1853271&view=diff
==============================================================================
--- jmeter/trunk/src/functions/org/apache/jmeter/functions/RegexFunction.java (original)
+++ jmeter/trunk/src/functions/org/apache/jmeter/functions/RegexFunction.java Sat Feb  9 13:13:47
2019
@@ -124,7 +124,7 @@ public class RegexFunction extends Abstr
                 inputVariable = ((CompoundVariable) values[6]).execute();
             }
         } catch (MalformedCachePatternException e) {
-            log.error("Malformed cache pattern:"+values[0], e);
+            log.error("Malformed cache pattern:{}", values[0], e);
             throw new InvalidVariableException("Malformed cache pattern:"+values[0], e);
         }
 

Modified: jmeter/trunk/src/functions/org/apache/jmeter/functions/SplitFunction.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/functions/org/apache/jmeter/functions/SplitFunction.java?rev=1853271&r1=1853270&r2=1853271&view=diff
==============================================================================
--- jmeter/trunk/src/functions/org/apache/jmeter/functions/SplitFunction.java (original)
+++ jmeter/trunk/src/functions/org/apache/jmeter/functions/SplitFunction.java Sat Feb  9 13:13:47
2019
@@ -91,9 +91,7 @@ public class SplitFunction extends Abstr
             String newSplitString = ((CompoundVariable) values[2]).execute();
             splitString = newSplitString.length() > 0 ? newSplitString : splitString;
         }
-        if (log.isDebugEnabled()){
-            log.debug("Split "+stringToSplit+ " using "+ splitString+ " into "+varNamePrefix);
-        }
+        log.debug("Split {} using {} into {}", stringToSplit, splitString, varNamePrefix);
         String[] parts = JOrphanUtils.split(stringToSplit, splitString, "?");// $NON-NLS-1$
 
         vars.put(varNamePrefix, stringToSplit);



Mime
View raw message