commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1710087 - in /commons/proper/configuration/trunk/src: main/java/org/apache/commons/configuration2/interpol/ExprLookup.java test/java/org/apache/commons/configuration2/interpol/TestExprLookup.java
Date Thu, 22 Oct 2015 19:47:54 GMT
Author: oheger
Date: Thu Oct 22 19:47:53 2015
New Revision: 1710087

URL: http://svn.apache.org/viewvc?rev=1710087&view=rev
Log:
ExprLookup now uses a ConfigurationLogger.

Modified:
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/interpol/ExprLookup.java
    commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/interpol/TestExprLookup.java

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/interpol/ExprLookup.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/interpol/ExprLookup.java?rev=1710087&r1=1710086&r2=1710087&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/interpol/ExprLookup.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/interpol/ExprLookup.java
Thu Oct 22 19:47:53 2015
@@ -18,6 +18,7 @@ package org.apache.commons.configuration
 
 import java.util.ArrayList;
 
+import org.apache.commons.configuration2.ConfigurationLogger;
 import org.apache.commons.configuration2.ex.ConfigurationRuntimeException;
 import org.apache.commons.jexl2.Expression;
 import org.apache.commons.jexl2.JexlContext;
@@ -27,7 +28,6 @@ import org.apache.commons.lang3.ClassUti
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.text.StrLookup;
 import org.apache.commons.lang3.text.StrSubstitutor;
-import org.apache.commons.logging.Log;
 
 /**
  * Lookup that allows expressions to be evaluated.
@@ -82,7 +82,7 @@ public class ExprLookup implements Looku
     private StrSubstitutor substitutor;
 
     /** The logger used by this instance. */
-    private Log logger;
+    private ConfigurationLogger logger;
 
     /** The engine. */
     private final JexlEngine engine = new JexlEngine();
@@ -170,7 +170,7 @@ public class ExprLookup implements Looku
      * @return the {@code Log}
      * @since 2.0
      */
-    public Log getLogger()
+    public ConfigurationLogger getLogger()
     {
         return logger;
     }
@@ -182,7 +182,7 @@ public class ExprLookup implements Looku
      * @param logger the {@code Log}
      * @since 2.0
      */
-    public void setLogger(Log logger)
+    public void setLogger(ConfigurationLogger logger)
     {
         this.logger = logger;
     }
@@ -232,10 +232,10 @@ public class ExprLookup implements Looku
         }
         catch (Exception e)
         {
-            Log l = getLogger();
+            ConfigurationLogger l = getLogger();
             if (l != null)
             {
-                l.debug("Error encountered evaluating " + result, e);
+                l.debug("Error encountered evaluating " + result + ": " + e);
             }
         }
 

Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/interpol/TestExprLookup.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/interpol/TestExprLookup.java?rev=1710087&r1=1710086&r2=1710087&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/interpol/TestExprLookup.java
(original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/interpol/TestExprLookup.java
Thu Oct 22 19:47:53 2015
@@ -64,10 +64,11 @@ public class TestExprLookup
         XMLConfiguration config = new XMLConfiguration();
         FileHandler handler = new FileHandler(config);
         handler.load(TEST_FILE);
-        config.setLogger(new ConfigurationLogger("TestLogger"));
+        ConfigurationLogger testLogger = new ConfigurationLogger("TestLogger");
+        config.setLogger(testLogger);
         ExprLookup lookup = new ExprLookup(vars);
         lookup.setInterpolator(config.getInterpolator());
-        lookup.setLogger(log);
+        lookup.setLogger(testLogger);
         String str = lookup.lookup(PATTERN1);
         assertTrue(str.startsWith("Goodbye"));
         str = lookup.lookup(PATTERN2);



Mime
View raw message