Reduces noise in the logs during development

This commit is contained in:
Lukasz Lenart
2016-11-16 10:14:41 +01:00
parent 931df54ab3
commit 8759bbc68a
@@ -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
*