View Javadoc

1   package net.sourceforge.argval.utils;
2   
3   
4   import java.lang.reflect.Method;
5   
6   
7   import net.sourceforge.argval.collection.CollectionUtil;
8   
9   import org.slf4j.Logger;
10  
11  
12  public final class LogUtil {
13  
14  
15      public static void logMethodParameters(Logger logger, Method method, String[] parameterNameArray, Object[] parameterValueArray) {
16          if (logger.isInfoEnabled()) {
17              logger.info(((method != null) ? method.getName() : "method incorrect initialized") + "  " + CollectionUtil.toString(parameterNameArray, parameterValueArray));
18          }
19      }
20  
21      public static void logMethodParameters(Logger logger, String methodName, String[] parameterNameArray, Object[] parameterValueArray) {
22          if (logger.isInfoEnabled()) {
23              logger.info(((methodName != null) ? methodName : "method name unknown") + "  " + CollectionUtil.toString(parameterNameArray, parameterValueArray));
24          }
25      }
26  
27  }