Repository: struts
Updated Branches:
  refs/heads/master 931df54ab -> 8759bbc68


Reduces noise in the logs during development


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/8759bbc6
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/8759bbc6
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/8759bbc6

Branch: refs/heads/master
Commit: 8759bbc68a9a7f34696d36281fe075b391be01b1
Parents: 931df54
Author: Lukasz Lenart <lukaszlen...@apache.org>
Authored: Wed Nov 16 10:14:41 2016 +0100
Committer: Lukasz Lenart <lukaszlen...@apache.org>
Committed: Wed Nov 16 10:14:41 2016 +0100

----------------------------------------------------------------------
 .../xwork2/interceptor/ParametersInterceptor.java     | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/8759bbc6/core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java
 
b/core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java
index 5770642..6867b3d 100644
--- 
a/core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java
+++ 
b/core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java
@@ -282,7 +282,7 @@ public class ParametersInterceptor extends 
MethodFilterInterceptor {
        protected boolean isWithinLengthLimit( String name ) {
         boolean matchLength = name.length() <= paramNameMaxLength;
         if (!matchLength) {
-            notifyDeveloper("Parameter [{}] is too long, allowed length is 
[{}]", name, String.valueOf(paramNameMaxLength));
+            LOG.debug("Parameter [{}] is too long, allowed length is [{}]", 
name, String.valueOf(paramNameMaxLength));
         }
         return matchLength;
        }
@@ -292,27 +292,19 @@ public class ParametersInterceptor extends 
MethodFilterInterceptor {
         if (result.isAccepted()) {
             return true;
         }
-        notifyDeveloper("Parameter [{}] didn't match accepted pattern [{}]!", 
paramName, result.getAcceptedPattern());
+        LOG.debug("Parameter [{}] didn't match accepted pattern [{}]!", 
paramName, result.getAcceptedPattern());
         return false;
     }
 
     protected boolean isExcluded(String paramName) {
         ExcludedPatternsChecker.IsExcluded result = 
excludedPatterns.isExcluded(paramName);
         if (result.isExcluded()) {
-            notifyDeveloper("Parameter [{}] matches excluded pattern [{}]!", 
paramName, result.getExcludedPattern());
+            LOG.debug("Parameter [{}] matches excluded pattern [{}]!", 
paramName, result.getExcludedPattern());
             return true;
         }
         return false;
     }
 
-    private void notifyDeveloper(String message, String... parameters) {
-        if (devMode) {
-            LOG.warn(message, parameters);
-        } else {
-            LOG.debug(message, parameters);
-        }
-    }
-
     /**
      * Whether to order the parameters or not
      *

Reply via email to