You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by ca...@apache.org on 2007/04/27 05:51:09 UTC
svn commit: r532947 [2/3] - in /logging/sandbox/log4j/formatter: ./
src/main/java/org/apache/log4j/ src/main/resources/META-INF/
src/test/java/org/apache/log4j/ src/test/resources/org/
src/test/resources/org/apache/ src/test/resources/org/apache/log4j/
Modified: logging/sandbox/log4j/formatter/src/main/java/org/apache/log4j/LogMF.java
URL: http://svn.apache.org/viewvc/logging/sandbox/log4j/formatter/src/main/java/org/apache/log4j/LogMF.java?view=diff&rev=532947&r1=532946&r2=532947
==============================================================================
--- logging/sandbox/log4j/formatter/src/main/java/org/apache/log4j/LogMF.java (original)
+++ logging/sandbox/log4j/formatter/src/main/java/org/apache/log4j/LogMF.java Thu Apr 26 20:51:08 2007
@@ -16,10 +16,11 @@
*/
package org.apache.log4j;
+import org.apache.log4j.spi.LoggingEvent;
+
import java.text.DateFormat;
import java.text.MessageFormat;
import java.text.NumberFormat;
-
import java.util.Date;
import java.util.ResourceBundle;
@@ -28,11 +29,13 @@
* This class provides static methods to
* format log messages using java.text.MessageFormat.
*
- * @author Curt Arnold
- *
*/
public final class LogMF {
/**
+ * Trace level.
+ */
+ private static final Level TRACE = getTraceLevel();
+ /**
* private constructor.
*
*/
@@ -41,6 +44,20 @@
/**
+ * Gets Trace level.
+ * Trace level was not defined prior to log4j 1.2.12.
+ * @return trace level
+ */
+ private static Level getTraceLevel() {
+ try {
+ return (Level) Level.class.getField("TRACE").get(null);
+ } catch (Exception ex) {
+ return new Level(5000, "TRACE", 7);
+ }
+ }
+
+
+ /**
* Returns a Boolean instance representing the specified boolean.
* Boolean.valueOf was added in JDK 1.4.
* @param b a boolean value.
@@ -54,6 +71,134 @@
}
/**
+ * Returns a Character instance representing the specified char.
+ * Character.valueOf was added in JDK 1.5.
+ * @param c a character value.
+ * @return a Character instance representing c.
+ */
+ private static Character valueOf(final char c) {
+ return new Character(c);
+ }
+
+ /**
+ * Returns a Byte instance representing the specified byte.
+ * Byte.valueOf was added in JDK 1.5.
+ * @param b a byte value.
+ * @return a Byte instance representing b.
+ */
+ private static Byte valueOf(final byte b) {
+ return new Byte(b);
+ }
+
+ /**
+ * Returns a Short instance representing the specified short.
+ * Short.valueOf was added in JDK 1.5.
+ * @param b a short value.
+ * @return a Byte instance representing b.
+ */
+ private static Short valueOf(final short b) {
+ return new Short(b);
+ }
+
+ /**
+ * Returns an Integer instance representing the specified int.
+ * Integer.valueOf was added in JDK 1.5.
+ * @param b an int value.
+ * @return an Integer instance representing b.
+ */
+ private static Integer valueOf(final int b) {
+ return new Integer(b);
+ }
+
+ /**
+ * Returns a Long instance representing the specified long.
+ * Long.valueOf was added in JDK 1.5.
+ * @param b a long value.
+ * @return a Long instance representing b.
+ */
+ private static Long valueOf(final long b) {
+ return new Long(b);
+ }
+
+ /**
+ * Returns a Float instance representing the specified float.
+ * Float.valueOf was added in JDK 1.5.
+ * @param b a float value.
+ * @return a Float instance representing b.
+ */
+ private static Float valueOf(final float b) {
+ return new Float(b);
+ }
+
+ /**
+ * Returns a Double instance representing the specified double.
+ * Double.valueOf was added in JDK 1.5.
+ * @param b a double value.
+ * @return a Byte instance representing b.
+ */
+ private static Double valueOf(final double b) {
+ return new Double(b);
+ }
+
+
+
+ /**
+ * Create new array.
+ * @param param1 parameter 1.
+ * @return new array.
+ */
+ private static Object[] toArray(final Object param1) {
+ return new Object[] {
+ param1
+ };
+ }
+
+ /**
+ * Create new array.
+ * @param param1 parameter 1.
+ * @param param2 parameter 2.
+ * @return new array.
+ */
+ private static Object[] toArray(final Object param1,
+ final Object param2) {
+ return new Object[] {
+ param1, param2
+ };
+ }
+
+ /**
+ * Create new array.
+ * @param param1 parameter 1.
+ * @param param2 parameter 2.
+ * @param param3 parameter 3.
+ * @return new array.
+ */
+ private static Object[] toArray(final Object param1,
+ final Object param2,
+ final Object param3) {
+ return new Object[] {
+ param1, param2, param3
+ };
+ }
+
+ /**
+ * Create new array.
+ * @param param1 parameter 1.
+ * @param param2 parameter 2.
+ * @param param3 parameter 3.
+ * @param param4 parameter 4.
+ * @return new array.
+ */
+ private static Object[] toArray(final Object param1,
+ final Object param2,
+ final Object param3,
+ final Object param4) {
+ return new Object[] {
+ param1, param2, param3, param4
+ };
+ }
+
+ /**
* Formats arguments using a minimal subset
* of MessageFormat syntax.
* @param pattern pattern, may not be null.
@@ -63,44 +208,47 @@
*/
private static String subsetFormat(final String pattern,
final Object arg0) {
- //
- // find position of first brace
- // if none then format is a literal
- int bracePos = pattern.indexOf("{");
-
- //
- // if the first format is {0}
- // and there are no other format specifiers
- // and no quotes then substitute for {0}
- if (bracePos != -1) {
- if ((pattern.indexOf("{0}", bracePos) == bracePos)
- && (pattern.indexOf("{", bracePos + 1) == -1)
- && (pattern.indexOf("'") == -1)) {
- String replacement;
-
- if (arg0 instanceof String) {
- replacement = arg0.toString();
- } else if (arg0 instanceof Number) {
- replacement = NumberFormat.getInstance().format(arg0);
- } else if (arg0 instanceof Date) {
- replacement = DateFormat.getDateTimeInstance(
- DateFormat.SHORT,
- DateFormat.SHORT).format(arg0);
- } else {
- replacement = String.valueOf(arg0);
- }
-
- final StringBuffer buf = new StringBuffer(pattern);
- buf.replace(bracePos, bracePos + "{0}".length(), replacement);
+ if (pattern != null) {
+ //
+ // find position of first brace
+ // if none then format is a literal
+ int bracePos = pattern.indexOf("{");
- return buf.toString();
- }
- } else {
//
- // pattern is a literal with no braces
- // and not quotes, return pattern.
- if (pattern.indexOf("'") == -1) {
- return pattern;
+ // if the first format is {0}
+ // and there are no other format specifiers
+ // and no quotes then substitute for {0}
+ if (bracePos != -1) {
+ if ((pattern.indexOf("{0}", bracePos) == bracePos)
+ && (pattern.indexOf("{", bracePos + 1) == -1)
+ && (pattern.indexOf("'") == -1)) {
+ String replacement;
+
+ if (arg0 instanceof String) {
+ replacement = arg0.toString();
+ } else if (arg0 instanceof Number) {
+ replacement = NumberFormat.getInstance().format(arg0);
+ } else if (arg0 instanceof Date) {
+ replacement = DateFormat.getDateTimeInstance(
+ DateFormat.SHORT,
+ DateFormat.SHORT).format(arg0);
+ } else {
+ replacement = String.valueOf(arg0);
+ }
+
+ final StringBuffer buf = new StringBuffer(pattern);
+ buf.replace(bracePos,
+ bracePos + "{0}".length(), replacement);
+
+ return buf.toString();
+ }
+ } else {
+ //
+ // pattern is a literal with no braces
+ // and not quotes, return pattern.
+ if (pattern.indexOf("'") == -1) {
+ return pattern;
+ }
}
}
@@ -109,12 +257,15 @@
/**
* Formats arguments using MessageFormat.
- * @param pattern pattern, may be malformed.
+ * @param pattern pattern, may be malformed or null.
* @param arguments arguments, may be null or mismatched.
- * @return Message string
+ * @return Message string or null
*/
private static String format(final String pattern,
final Object[] arguments) {
+ if (pattern == null) {
+ return null;
+ }
try {
return MessageFormat.format(pattern, arguments);
} catch (IllegalArgumentException ex) {
@@ -132,38 +283,74 @@
String msg = subsetFormat(pattern, arg0);
if (msg == null) {
- try {
- msg = MessageFormat.format(pattern, new Object[] {
- arg0
- });
- } catch (IllegalArgumentException ex) {
- msg = pattern;
- }
+ msg = format(pattern, toArray(arg0));
}
return msg;
}
/**
- * Gets a message format pattern from a resource bundle by key.
- * @param bundle bundle, may not be null.
- * @param key key, may not be null.
- * @return pattern retrieved pattern or
- */
- private static String getPattern(final ResourceBundle bundle,
- final String key) {
- String pattern = bundle.getString(key);
-
- if (pattern == null) {
- pattern = "Unable to find key \"" + key + "\" in bundle "
- + bundle.toString();
+ * Formats arguments using MessageFormat using a pattern from
+ * a resource bundle.
+ * @param resourceBundleName name of resource bundle, may be null.
+ * @param key key for pattern in resource bundle, may be null.
+ * @param arguments arguments, may be null or mismatched.
+ * @return Message string or null
+ */
+ private static String format(
+ final String resourceBundleName,
+ final String key,
+ final Object[] arguments) {
+ String pattern;
+ if (resourceBundleName != null) {
+ try {
+ ResourceBundle bundle =
+ ResourceBundle.getBundle(resourceBundleName);
+ pattern = bundle.getString(key);
+ } catch (Exception ex) {
+ pattern = key;
+ }
+ } else {
+ pattern = key;
}
+ return format(pattern, arguments);
+ }
+
+
+ /**
+ * Fully Qualified Class Name of this class.
+ */
+ private static final String FQCN = LogMF.class.getName();
- return pattern;
+ /**
+ * Equivalent of Logger.forcedLog.
+ *
+ * @param logger logger, may not be null.
+ * @param level level, may not be null.
+ * @param msg message, may be null.
+ */
+ private static void forcedLog(final Logger logger,
+ final Level level,
+ final String msg) {
+ logger.callAppenders(new LoggingEvent(FQCN, logger, level, msg, null));
}
/**
- * Log a parameterized message at debug level.
+ * Equivalent of Logger.forcedLog.
+ *
+ * @param logger logger, may not be null.
+ * @param level level, may not be null.
+ * @param msg message, may be null.
+ * @param t throwable.
+ */
+ private static void forcedLog(final Logger logger,
+ final Level level,
+ final String msg,
+ final Throwable t) {
+ logger.callAppenders(new LoggingEvent(FQCN, logger, level, msg, t));
+ }
+ /**
+ * Log a parameterized message at trace level.
* @param logger logger, may not be null.
* @param pattern pattern, may be null.
* @param arguments an array of arguments to be
@@ -171,8 +358,8 @@
*/
public static void trace(final Logger logger, final String pattern,
final Object[] arguments) {
- if ((pattern != null) && logger.isTraceEnabled()) {
- logger.trace(format(pattern, arguments));
+ if (logger.isEnabledFor(TRACE)) {
+ forcedLog(logger, TRACE, format(pattern, arguments));
}
}
@@ -184,8 +371,8 @@
*/
public static void debug(final Logger logger, final String pattern,
final Object[] arguments) {
- if ((pattern != null) && logger.isDebugEnabled()) {
- logger.debug(format(pattern, arguments));
+ if (logger.isDebugEnabled()) {
+ forcedLog(logger, Level.DEBUG, format(pattern, arguments));
}
}
@@ -197,8 +384,8 @@
*/
public static void info(final Logger logger, final String pattern,
final Object[] arguments) {
- if ((pattern != null) && logger.isInfoEnabled()) {
- logger.info(format(pattern, arguments));
+ if (logger.isInfoEnabled()) {
+ forcedLog(logger, Level.INFO, format(pattern, arguments));
}
}
@@ -210,8 +397,8 @@
*/
public static void warn(final Logger logger, final String pattern,
final Object[] arguments) {
- if ((pattern != null) && logger.isEnabledFor(Level.WARN)) {
- logger.warn(format(pattern, arguments));
+ if (logger.isEnabledFor(Level.WARN)) {
+ forcedLog(logger, Level.WARN, format(pattern, arguments));
}
}
@@ -223,8 +410,8 @@
*/
public static void error(final Logger logger, final String pattern,
final Object[] arguments) {
- if ((pattern != null) && logger.isEnabledFor(Level.ERROR)) {
- logger.error(format(pattern, arguments));
+ if (logger.isEnabledFor(Level.ERROR)) {
+ forcedLog(logger, Level.ERROR, format(pattern, arguments));
}
}
@@ -236,11 +423,110 @@
*/
public static void fatal(final Logger logger, final String pattern,
final Object[] arguments) {
- if ((pattern != null) && logger.isEnabledFor(Level.FATAL)) {
- logger.fatal(format(pattern, arguments));
+ if (logger.isEnabledFor(Level.FATAL)) {
+ forcedLog(logger, Level.FATAL, format(pattern, arguments));
+ }
+ }
+
+ /**
+ * Log a parameterized message at trace level.
+ * @param logger logger, may not be null.
+ * @param t throwable, may be null.
+ * @param pattern pattern, may be null.
+ * @param arguments an array of arguments to be
+ * formatted and substituted.
+ */
+ public static void trace(final Logger logger,
+ final Throwable t,
+ final String pattern,
+ final Object[] arguments) {
+ if (logger.isEnabledFor(TRACE)) {
+ forcedLog(logger, TRACE, format(pattern, arguments), t);
+ }
+ }
+
+ /**
+ * Log a parameterized message at debug level.
+ * @param logger logger, may not be null.
+ * @param t throwable, may be null.
+ * @param pattern pattern, may be null.
+ * @param arguments an array of arguments to be formatted and substituted.
+ */
+ public static void debug(final Logger logger,
+ final Throwable t,
+ final String pattern,
+ final Object[] arguments) {
+ if (logger.isDebugEnabled()) {
+ forcedLog(logger, Level.DEBUG, format(pattern, arguments), t);
+ }
+ }
+
+ /**
+ * Log a parameterized message at info level.
+ * @param logger logger, may not be null.
+ * @param t throwable, may be null.
+ * @param pattern pattern, may be null.
+ * @param arguments an array of arguments to be formatted and substituted.
+ */
+ public static void info(final Logger logger,
+ final Throwable t,
+ final String pattern,
+ final Object[] arguments) {
+ if (logger.isInfoEnabled()) {
+ forcedLog(logger, Level.INFO, format(pattern, arguments), t);
+ }
+ }
+
+ /**
+ * Log a parameterized message at warn level.
+ * @param logger logger, may not be null.
+ * @param t throwable, may be null.
+ * @param pattern pattern, may be null.
+ * @param arguments an array of arguments to be formatted and substituted.
+ */
+ public static void warn(final Logger logger,
+ final Throwable t,
+ final String pattern,
+ final Object[] arguments) {
+ if (logger.isEnabledFor(Level.WARN)) {
+ forcedLog(logger, Level.WARN, format(pattern, arguments), t);
+ }
+ }
+
+ /**
+ * Log a parameterized message at error level.
+ * @param logger logger, may not be null.
+ * @param t throwable, may be null.
+ * @param pattern pattern, may be null.
+ * @param arguments an array of arguments to be formatted and substituted.
+ */
+ public static void error(final Logger logger,
+ final Throwable t,
+ final String pattern,
+ final Object[] arguments) {
+ if (logger.isEnabledFor(Level.ERROR)) {
+ forcedLog(logger, Level.ERROR, format(pattern, arguments), t);
+ }
+ }
+
+ /**
+ * Log a parameterized message at fatal level.
+ * @param logger logger, may not be null.
+ * @param t throwable, may be null.
+ * @param pattern pattern, may be null.
+ * @param arguments an array of arguments to be formatted and substituted.
+ */
+ public static void fatal(final Logger logger,
+ final Throwable t,
+ final String pattern,
+ final Object[] arguments) {
+ if (logger.isEnabledFor(Level.FATAL)) {
+ forcedLog(logger, Level.FATAL, format(pattern, arguments), t);
}
}
+
+
/**
* Log a parameterized message at trace level.
* @param logger logger, may not be null.
@@ -249,8 +535,8 @@
*/
public static void trace(final Logger logger, final String pattern,
final boolean argument) {
- if ((pattern != null) && logger.isTraceEnabled()) {
- logger.trace(format(pattern, valueOf(argument)));
+ if (logger.isEnabledFor(TRACE)) {
+ forcedLog(logger, TRACE, format(pattern, valueOf(argument)));
}
}
@@ -262,8 +548,8 @@
*/
public static void trace(final Logger logger, final String pattern,
final char argument) {
- if ((pattern != null) && logger.isTraceEnabled()) {
- logger.trace(format(pattern, new Character(argument)));
+ if (logger.isEnabledFor(TRACE)) {
+ forcedLog(logger, TRACE, format(pattern, valueOf(argument)));
}
}
@@ -275,8 +561,8 @@
*/
public static void trace(final Logger logger, final String pattern,
final byte argument) {
- if ((pattern != null) && logger.isTraceEnabled()) {
- logger.trace(format(pattern, new Byte(argument)));
+ if (logger.isEnabledFor(TRACE)) {
+ forcedLog(logger, TRACE, format(pattern, valueOf(argument)));
}
}
@@ -288,8 +574,8 @@
*/
public static void trace(final Logger logger, final String pattern,
final short argument) {
- if ((pattern != null) && logger.isTraceEnabled()) {
- logger.trace(format(pattern, new Short(argument)));
+ if (logger.isEnabledFor(TRACE)) {
+ forcedLog(logger, TRACE, format(pattern, valueOf(argument)));
}
}
@@ -301,8 +587,8 @@
*/
public static void trace(final Logger logger, final String pattern,
final int argument) {
- if ((pattern != null) && logger.isTraceEnabled()) {
- logger.trace(format(pattern, new Integer(argument)));
+ if (logger.isEnabledFor(TRACE)) {
+ forcedLog(logger, TRACE, format(pattern, valueOf(argument)));
}
}
@@ -314,8 +600,8 @@
*/
public static void trace(final Logger logger, final String pattern,
final long argument) {
- if ((pattern != null) && logger.isTraceEnabled()) {
- logger.trace(format(pattern, new Long(argument)));
+ if (logger.isEnabledFor(TRACE)) {
+ forcedLog(logger, TRACE, format(pattern, valueOf(argument)));
}
}
@@ -327,8 +613,8 @@
*/
public static void trace(final Logger logger, final String pattern,
final float argument) {
- if ((pattern != null) && logger.isTraceEnabled()) {
- logger.trace(format(pattern, new Float(argument)));
+ if (logger.isEnabledFor(TRACE)) {
+ forcedLog(logger, TRACE, format(pattern, valueOf(argument)));
}
}
@@ -340,8 +626,8 @@
*/
public static void trace(final Logger logger, final String pattern,
final double argument) {
- if ((pattern != null) && logger.isTraceEnabled()) {
- logger.trace(format(pattern, new Double(argument)));
+ if (logger.isEnabledFor(TRACE)) {
+ forcedLog(logger, TRACE, format(pattern, valueOf(argument)));
}
}
@@ -353,8 +639,8 @@
*/
public static void trace(final Logger logger, final String pattern,
final Object argument) {
- if ((pattern != null) && logger.isTraceEnabled()) {
- logger.trace(format(pattern, argument));
+ if (logger.isEnabledFor(TRACE)) {
+ forcedLog(logger, TRACE, format(pattern, argument));
}
}
@@ -367,10 +653,9 @@
*/
public static void trace(final Logger logger, final String pattern,
final Object arg0, final Object arg1) {
- if ((pattern != null) && logger.isTraceEnabled()) {
- logger.trace(format(pattern, new Object[] {
- arg0, arg1
- }));
+ if (logger.isEnabledFor(TRACE)) {
+ forcedLog(logger, TRACE,
+ format(pattern, toArray(arg0, arg1)));
}
}
@@ -384,10 +669,9 @@
*/
public static void trace(final Logger logger, final String pattern,
final Object arg0, final Object arg1, final Object arg2) {
- if ((pattern != null) && logger.isTraceEnabled()) {
- logger.trace(format(pattern, new Object[] {
- arg0, arg1, arg2
- }));
+ if (logger.isEnabledFor(TRACE)) {
+ forcedLog(logger, TRACE,
+ format(pattern, toArray(arg0, arg1, arg2)));
}
}
@@ -403,10 +687,9 @@
public static void trace(final Logger logger, final String pattern,
final Object arg0, final Object arg1, final Object arg2,
final Object arg3) {
- if ((pattern != null) && logger.isTraceEnabled()) {
- logger.trace(format(pattern, new Object[] {
- arg0, arg1, arg2, arg3
- }));
+ if (logger.isEnabledFor(TRACE)) {
+ forcedLog(logger, TRACE,
+ format(pattern, toArray(arg0, arg1, arg2, arg3)));
}
}
@@ -418,8 +701,8 @@
*/
public static void debug(final Logger logger, final String pattern,
final boolean argument) {
- if ((pattern != null) && logger.isDebugEnabled()) {
- logger.debug(format(pattern, valueOf(argument)));
+ if (logger.isDebugEnabled()) {
+ forcedLog(logger, Level.DEBUG, format(pattern, valueOf(argument)));
}
}
@@ -431,8 +714,8 @@
*/
public static void debug(final Logger logger, final String pattern,
final char argument) {
- if ((pattern != null) && logger.isDebugEnabled()) {
- logger.debug(format(pattern, new Character(argument)));
+ if (logger.isDebugEnabled()) {
+ forcedLog(logger, Level.DEBUG, format(pattern, valueOf(argument)));
}
}
@@ -444,8 +727,8 @@
*/
public static void debug(final Logger logger, final String pattern,
final byte argument) {
- if ((pattern != null) && logger.isDebugEnabled()) {
- logger.debug(format(pattern, new Byte(argument)));
+ if (logger.isDebugEnabled()) {
+ forcedLog(logger, Level.DEBUG, format(pattern, valueOf(argument)));
}
}
@@ -457,8 +740,8 @@
*/
public static void debug(final Logger logger, final String pattern,
final short argument) {
- if ((pattern != null) && logger.isDebugEnabled()) {
- logger.debug(format(pattern, new Short(argument)));
+ if (logger.isDebugEnabled()) {
+ forcedLog(logger, Level.DEBUG, format(pattern, valueOf(argument)));
}
}
@@ -470,8 +753,8 @@
*/
public static void debug(final Logger logger, final String pattern,
final int argument) {
- if ((pattern != null) && logger.isDebugEnabled()) {
- logger.debug(format(pattern, new Integer(argument)));
+ if (logger.isDebugEnabled()) {
+ forcedLog(logger, Level.DEBUG, format(pattern, valueOf(argument)));
}
}
@@ -483,8 +766,8 @@
*/
public static void debug(final Logger logger, final String pattern,
final long argument) {
- if ((pattern != null) && logger.isDebugEnabled()) {
- logger.debug(format(pattern, new Long(argument)));
+ if (logger.isDebugEnabled()) {
+ forcedLog(logger, Level.DEBUG, format(pattern, valueOf(argument)));
}
}
@@ -496,8 +779,8 @@
*/
public static void debug(final Logger logger, final String pattern,
final float argument) {
- if ((pattern != null) && logger.isDebugEnabled()) {
- logger.debug(format(pattern, new Float(argument)));
+ if (logger.isDebugEnabled()) {
+ forcedLog(logger, Level.DEBUG, format(pattern, valueOf(argument)));
}
}
@@ -509,8 +792,8 @@
*/
public static void debug(final Logger logger, final String pattern,
final double argument) {
- if ((pattern != null) && logger.isDebugEnabled()) {
- logger.debug(format(pattern, new Double(argument)));
+ if (logger.isDebugEnabled()) {
+ forcedLog(logger, Level.DEBUG, format(pattern, valueOf(argument)));
}
}
@@ -522,8 +805,8 @@
*/
public static void debug(final Logger logger, final String pattern,
final Object argument) {
- if ((pattern != null) && logger.isDebugEnabled()) {
- logger.debug(format(pattern, argument));
+ if (logger.isDebugEnabled()) {
+ forcedLog(logger, Level.DEBUG, format(pattern, argument));
}
}
@@ -536,8 +819,9 @@
*/
public static void debug(final Logger logger, final String pattern,
final Object arg0, final Object arg1) {
- if ((pattern != null) && logger.isDebugEnabled()) {
- logger.debug(format(pattern, new Object[] { arg0, arg1 }));
+ if (logger.isDebugEnabled()) {
+ forcedLog(logger, Level.DEBUG,
+ format(pattern, toArray(arg0, arg1)));
}
}
@@ -551,8 +835,9 @@
*/
public static void debug(final Logger logger, final String pattern,
final Object arg0, final Object arg1, final Object arg2) {
- if ((pattern != null) && logger.isDebugEnabled()) {
- logger.debug(format(pattern, new Object[] { arg0, arg1, arg2 }));
+ if (logger.isDebugEnabled()) {
+ forcedLog(logger, Level.DEBUG,
+ format(pattern, toArray(arg0, arg1, arg2)));
}
}
@@ -568,10 +853,9 @@
public static void debug(final Logger logger, final String pattern,
final Object arg0, final Object arg1, final Object arg2,
final Object arg3) {
- if ((pattern != null) && logger.isDebugEnabled()) {
- logger.debug(format(pattern, new Object[] {
- arg0, arg1, arg2, arg3
- }));
+ if (logger.isDebugEnabled()) {
+ forcedLog(logger, Level.DEBUG,
+ format(pattern, toArray(arg0, arg1, arg2, arg3)));
}
}
@@ -583,8 +867,8 @@
*/
public static void info(final Logger logger, final String pattern,
final boolean argument) {
- if ((pattern != null) && logger.isInfoEnabled()) {
- logger.info(format(pattern, valueOf(argument)));
+ if (logger.isInfoEnabled()) {
+ forcedLog(logger, Level.INFO, format(pattern, valueOf(argument)));
}
}
@@ -596,8 +880,8 @@
*/
public static void info(final Logger logger, final String pattern,
final char argument) {
- if ((pattern != null) && logger.isInfoEnabled()) {
- logger.info(format(pattern, new Character(argument)));
+ if (logger.isInfoEnabled()) {
+ forcedLog(logger, Level.INFO, format(pattern, valueOf(argument)));
}
}
@@ -609,8 +893,8 @@
*/
public static void info(final Logger logger, final String pattern,
final byte argument) {
- if ((pattern != null) && logger.isInfoEnabled()) {
- logger.info(format(pattern, new Byte(argument)));
+ if (logger.isInfoEnabled()) {
+ forcedLog(logger, Level.INFO, format(pattern, valueOf(argument)));
}
}
@@ -622,8 +906,8 @@
*/
public static void info(final Logger logger, final String pattern,
final short argument) {
- if ((pattern != null) && logger.isInfoEnabled()) {
- logger.info(format(pattern, new Short(argument)));
+ if (logger.isInfoEnabled()) {
+ forcedLog(logger, Level.INFO, format(pattern, valueOf(argument)));
}
}
@@ -635,8 +919,8 @@
*/
public static void info(final Logger logger, final String pattern,
final int argument) {
- if ((pattern != null) && logger.isInfoEnabled()) {
- logger.info(format(pattern, new Integer(argument)));
+ if (logger.isInfoEnabled()) {
+ forcedLog(logger, Level.INFO, format(pattern, valueOf(argument)));
}
}
@@ -648,8 +932,8 @@
*/
public static void info(final Logger logger, final String pattern,
final long argument) {
- if ((pattern != null) && logger.isInfoEnabled()) {
- logger.info(format(pattern, new Long(argument)));
+ if (logger.isInfoEnabled()) {
+ forcedLog(logger, Level.INFO, format(pattern, valueOf(argument)));
}
}
@@ -661,8 +945,8 @@
*/
public static void info(final Logger logger, final String pattern,
final float argument) {
- if ((pattern != null) && logger.isInfoEnabled()) {
- logger.info(format(pattern, new Float(argument)));
+ if (logger.isInfoEnabled()) {
+ forcedLog(logger, Level.INFO, format(pattern, valueOf(argument)));
}
}
@@ -674,8 +958,8 @@
*/
public static void info(final Logger logger, final String pattern,
final double argument) {
- if ((pattern != null) && logger.isInfoEnabled()) {
- logger.info(format(pattern, new Double(argument)));
+ if (logger.isInfoEnabled()) {
+ forcedLog(logger, Level.INFO, format(pattern, valueOf(argument)));
}
}
@@ -687,8 +971,8 @@
*/
public static void info(final Logger logger, final String pattern,
final Object argument) {
- if ((pattern != null) && logger.isInfoEnabled()) {
- logger.info(format(pattern, argument));
+ if (logger.isInfoEnabled()) {
+ forcedLog(logger, Level.INFO, format(pattern, argument));
}
}
@@ -701,8 +985,8 @@
*/
public static void info(final Logger logger, final String pattern,
final Object arg0, final Object arg1) {
- if ((pattern != null) && logger.isInfoEnabled()) {
- logger.info(format(pattern, new Object[] { arg0, arg1 }));
+ if (logger.isInfoEnabled()) {
+ forcedLog(logger, Level.INFO, format(pattern, toArray(arg0, arg1)));
}
}
@@ -716,8 +1000,9 @@
*/
public static void info(final Logger logger, final String pattern,
final Object arg0, final Object arg1, final Object arg2) {
- if ((pattern != null) && logger.isInfoEnabled()) {
- logger.info(format(pattern, new Object[] { arg0, arg1, arg2 }));
+ if (logger.isInfoEnabled()) {
+ forcedLog(logger, Level.INFO, format(pattern,
+ toArray(arg0, arg1, arg2)));
}
}
@@ -733,8 +1018,9 @@
public static void info(final Logger logger, final String pattern,
final Object arg0, final Object arg1, final Object arg2,
final Object arg3) {
- if ((pattern != null) && logger.isInfoEnabled()) {
- logger.info(format(pattern, new Object[] { arg0, arg1, arg2, arg3 }));
+ if (logger.isInfoEnabled()) {
+ forcedLog(logger, Level.INFO, format(pattern,
+ toArray(arg0, arg1, arg2, arg3)));
}
}
@@ -746,8 +1032,8 @@
*/
public static void warn(final Logger logger, final String pattern,
final boolean argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.WARN)) {
- logger.warn(format(pattern, valueOf(argument)));
+ if (logger.isEnabledFor(Level.WARN)) {
+ forcedLog(logger, Level.WARN, format(pattern, valueOf(argument)));
}
}
@@ -759,8 +1045,8 @@
*/
public static void warn(final Logger logger, final String pattern,
final char argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.WARN)) {
- logger.warn(format(pattern, new Character(argument)));
+ if (logger.isEnabledFor(Level.WARN)) {
+ forcedLog(logger, Level.WARN, format(pattern, valueOf(argument)));
}
}
@@ -772,8 +1058,8 @@
*/
public static void warn(final Logger logger, final String pattern,
final byte argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.WARN)) {
- logger.warn(format(pattern, new Byte(argument)));
+ if (logger.isEnabledFor(Level.WARN)) {
+ forcedLog(logger, Level.WARN, format(pattern, valueOf(argument)));
}
}
@@ -785,8 +1071,8 @@
*/
public static void warn(final Logger logger, final String pattern,
final short argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.WARN)) {
- logger.warn(format(pattern, new Short(argument)));
+ if (logger.isEnabledFor(Level.WARN)) {
+ forcedLog(logger, Level.WARN, format(pattern, valueOf(argument)));
}
}
@@ -798,8 +1084,8 @@
*/
public static void warn(final Logger logger, final String pattern,
final int argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.WARN)) {
- logger.warn(format(pattern, new Integer(argument)));
+ if (logger.isEnabledFor(Level.WARN)) {
+ forcedLog(logger, Level.WARN, format(pattern, valueOf(argument)));
}
}
@@ -811,8 +1097,8 @@
*/
public static void warn(final Logger logger, final String pattern,
final long argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.WARN)) {
- logger.warn(format(pattern, new Long(argument)));
+ if (logger.isEnabledFor(Level.WARN)) {
+ forcedLog(logger, Level.WARN, format(pattern, valueOf(argument)));
}
}
@@ -824,8 +1110,8 @@
*/
public static void warn(final Logger logger, final String pattern,
final float argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.WARN)) {
- logger.warn(format(pattern, new Float(argument)));
+ if (logger.isEnabledFor(Level.WARN)) {
+ forcedLog(logger, Level.WARN, format(pattern, valueOf(argument)));
}
}
@@ -837,8 +1123,8 @@
*/
public static void warn(final Logger logger, final String pattern,
final double argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.WARN)) {
- logger.warn(format(pattern, new Double(argument)));
+ if (logger.isEnabledFor(Level.WARN)) {
+ forcedLog(logger, Level.WARN, format(pattern, valueOf(argument)));
}
}
@@ -850,8 +1136,8 @@
*/
public static void warn(final Logger logger, final String pattern,
final Object argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.WARN)) {
- logger.warn(format(pattern, argument));
+ if (logger.isEnabledFor(Level.WARN)) {
+ forcedLog(logger, Level.WARN, format(pattern, argument));
}
}
@@ -864,8 +1150,9 @@
*/
public static void warn(final Logger logger, final String pattern,
final Object arg0, final Object arg1) {
- if ((pattern != null) && logger.isEnabledFor(Level.WARN)) {
- logger.warn(format(pattern, new Object[] { arg0, arg1 }));
+ if (logger.isEnabledFor(Level.WARN)) {
+ forcedLog(logger, Level.WARN,
+ format(pattern, toArray(arg0, arg1)));
}
}
@@ -879,8 +1166,9 @@
*/
public static void warn(final Logger logger, final String pattern,
final Object arg0, final Object arg1, final Object arg2) {
- if ((pattern != null) && logger.isEnabledFor(Level.WARN)) {
- logger.warn(format(pattern, new Object[] { arg0, arg1, arg2 }));
+ if (logger.isEnabledFor(Level.WARN)) {
+ forcedLog(logger, Level.WARN,
+ format(pattern, toArray(arg0, arg1, arg2)));
}
}
@@ -896,1544 +1184,546 @@
public static void warn(final Logger logger, final String pattern,
final Object arg0, final Object arg1, final Object arg2,
final Object arg3) {
- if ((pattern != null) && logger.isEnabledFor(Level.WARN)) {
- logger.warn(format(pattern, new Object[] { arg0, arg1, arg2, arg3 }));
+ if (logger.isEnabledFor(Level.WARN)) {
+ forcedLog(logger, Level.WARN, format(pattern,
+ toArray(arg0, arg1, arg2, arg3)));
}
}
/**
- * Log a parameterized message at error level.
- * @param logger logger, may not be null.
- * @param pattern pattern, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void error(final Logger logger, final String pattern,
- final boolean argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.ERROR)) {
- logger.error(format(pattern, valueOf(argument)));
+ * Log a parameterized message at specified level.
+ * @param logger logger, may not be null.
+ * @param level level, may not be null.
+ * @param pattern pattern, may be null.
+ * @param parameters parameters to the log message.
+ */
+ public static void log(final Logger logger,
+ final Level level,
+ final String pattern,
+ final Object[] parameters) {
+ if (logger.isEnabledFor(level)) {
+ forcedLog(logger, level,
+ format(pattern, parameters));
}
}
/**
- * Log a parameterized message at error level.
- * @param logger logger, may not be null.
- * @param pattern pattern, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void error(final Logger logger, final String pattern,
- final char argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.ERROR)) {
- logger.error(format(pattern, new Character(argument)));
+ * Log a parameterized message at specified level.
+ * @param logger logger, may not be null.
+ * @param level level, may not be null.
+ * @param t throwable, may be null.
+ * @param pattern pattern, may be null.
+ * @param parameters parameters to the log message.
+ */
+ public static void log(final Logger logger,
+ final Level level,
+ final Throwable t,
+ final String pattern,
+ final Object[] parameters) {
+ if (logger.isEnabledFor(level)) {
+ forcedLog(logger, level,
+ format(pattern, parameters), t);
}
}
/**
- * Log a parameterized message at error level.
- * @param logger logger, may not be null.
- * @param pattern pattern, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void error(final Logger logger, final String pattern,
- final byte argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.ERROR)) {
- logger.error(format(pattern, new Byte(argument)));
+ * Log a parameterized message at specified level.
+ * @param logger logger, may not be null.
+ * @param level level, may not be null.
+ * @param pattern pattern, may be null.
+ * @param param1 parameter to the log message.
+ */
+ public static void log(final Logger logger,
+ final Level level,
+ final String pattern,
+ final Object param1) {
+ if (logger.isEnabledFor(level)) {
+ forcedLog(logger, level,
+ format(pattern, toArray(param1)));
}
}
/**
- * Log a parameterized message at error level.
- * @param logger logger, may not be null.
- * @param pattern pattern, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void error(final Logger logger, final String pattern,
- final short argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.ERROR)) {
- logger.error(format(pattern, new Short(argument)));
+ * Log a parameterized message at specified level.
+ * @param logger logger, may not be null.
+ * @param level level, may not be null.
+ * @param pattern pattern, may be null.
+ * @param param1 parameter to the log message.
+ */
+ public static void log(final Logger logger,
+ final Level level,
+ final String pattern,
+ final boolean param1) {
+ if (logger.isEnabledFor(level)) {
+ forcedLog(logger, level,
+ format(pattern, toArray(valueOf(param1))));
}
}
+
/**
- * Log a parameterized message at error level.
- * @param logger logger, may not be null.
- * @param pattern pattern, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void error(final Logger logger, final String pattern,
- final int argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.ERROR)) {
- logger.error(format(pattern, new Integer(argument)));
+ * Log a parameterized message at specified level.
+ * @param logger logger, may not be null.
+ * @param level level, may not be null.
+ * @param pattern pattern, may be null.
+ * @param param1 parameter to the log message.
+ */
+ public static void log(final Logger logger,
+ final Level level,
+ final String pattern,
+ final byte param1) {
+ if (logger.isEnabledFor(level)) {
+ forcedLog(logger, level,
+ format(pattern, toArray(valueOf(param1))));
+ }
+ }
+
+
+ /**
+ * Log a parameterized message at specified level.
+ * @param logger logger, may not be null.
+ * @param level level, may not be null.
+ * @param pattern pattern, may be null.
+ * @param param1 parameter to the log message.
+ */
+ public static void log(final Logger logger,
+ final Level level,
+ final String pattern,
+ final char param1) {
+ if (logger.isEnabledFor(level)) {
+ forcedLog(logger, level,
+ format(pattern, toArray(valueOf(param1))));
}
}
/**
- * Log a parameterized message at error level.
- * @param logger logger, may not be null.
- * @param pattern pattern, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void error(final Logger logger, final String pattern,
- final long argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.ERROR)) {
- logger.error(format(pattern, new Long(argument)));
+ * Log a parameterized message at specified level.
+ * @param logger logger, may not be null.
+ * @param level level, may not be null.
+ * @param pattern pattern, may be null.
+ * @param param1 parameter to the log message.
+ */
+ public static void log(final Logger logger,
+ final Level level,
+ final String pattern,
+ final short param1) {
+ if (logger.isEnabledFor(level)) {
+ forcedLog(logger, level,
+ format(pattern, toArray(valueOf(param1))));
}
}
/**
- * Log a parameterized message at error level.
- * @param logger logger, may not be null.
- * @param pattern pattern, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void error(final Logger logger, final String pattern,
- final float argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.ERROR)) {
- logger.error(format(pattern, new Float(argument)));
+ * Log a parameterized message at specified level.
+ * @param logger logger, may not be null.
+ * @param level level, may not be null.
+ * @param pattern pattern, may be null.
+ * @param param1 parameter to the log message.
+ */
+ public static void log(final Logger logger,
+ final Level level,
+ final String pattern,
+ final int param1) {
+ if (logger.isEnabledFor(level)) {
+ forcedLog(logger, level,
+ format(pattern, toArray(valueOf(param1))));
}
}
+
/**
- * Log a parameterized message at error level.
- * @param logger logger, may not be null.
- * @param pattern pattern, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void error(final Logger logger, final String pattern,
- final double argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.ERROR)) {
- logger.error(format(pattern, new Double(argument)));
+ * Log a parameterized message at specified level.
+ * @param logger logger, may not be null.
+ * @param level level, may not be null.
+ * @param pattern pattern, may be null.
+ * @param param1 parameter to the log message.
+ */
+ public static void log(final Logger logger,
+ final Level level,
+ final String pattern,
+ final long param1) {
+ if (logger.isEnabledFor(level)) {
+ forcedLog(logger, level,
+ format(pattern, toArray(valueOf(param1))));
}
}
+
/**
- * Log a parameterized message at error level.
- * @param logger logger, may not be null.
- * @param pattern pattern, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void error(final Logger logger, final String pattern,
- final Object argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.ERROR)) {
- logger.error(format(pattern, argument));
+ * Log a parameterized message at specified level.
+ * @param logger logger, may not be null.
+ * @param level level, may not be null.
+ * @param pattern pattern, may be null.
+ * @param param1 parameter to the log message.
+ */
+ public static void log(final Logger logger,
+ final Level level,
+ final String pattern,
+ final float param1) {
+ if (logger.isEnabledFor(level)) {
+ forcedLog(logger, level,
+ format(pattern, toArray(valueOf(param1))));
}
}
+
/**
- * Log a parameterized message at error level.
+ * Log a parameterized message at specified level.
+ * @param logger logger, may not be null.
+ * @param level level, may not be null.
+ * @param pattern pattern, may be null.
+ * @param param1 parameter to the log message.
+ */
+ public static void log(final Logger logger,
+ final Level level,
+ final String pattern,
+ final double param1) {
+ if (logger.isEnabledFor(level)) {
+ forcedLog(logger, level,
+ format(pattern, toArray(valueOf(param1))));
+ }
+ }
+
+
+ /**
+ * Log a parameterized message at specified level.
* @param logger logger, may not be null.
+ * @param level level, may not be null.
* @param pattern pattern, may be null.
* @param arg0 a value to be formatted and substituted.
* @param arg1 a value to be formatted and substituted.
*/
- public static void error(final Logger logger, final String pattern,
+ public static void log(final Logger logger,
+ final Level level,
+ final String pattern,
final Object arg0, final Object arg1) {
- if ((pattern != null) && logger.isEnabledFor(Level.ERROR)) {
- logger.error(format(pattern, new Object[] { arg0, arg1 }));
+ if (logger.isEnabledFor(level)) {
+ forcedLog(logger, level,
+ format(pattern, toArray(arg0, arg1)));
}
}
/**
- * Log a parameterized message at error level.
+ * Log a parameterized message at specifed level.
* @param logger logger, may not be null.
+ * @param level level, may not be null.
* @param pattern pattern, may be null.
* @param arg0 a value to be formatted and substituted.
* @param arg1 a value to be formatted and substituted.
* @param arg2 a value to be formatted and substituted.
*/
- public static void error(final Logger logger, final String pattern,
+ public static void log(final Logger logger,
+ final Level level,
+ final String pattern,
final Object arg0, final Object arg1, final Object arg2) {
- if ((pattern != null) && logger.isEnabledFor(Level.ERROR)) {
- logger.error(format(pattern, new Object[] { arg0, arg1, arg2 }));
+ if (logger.isEnabledFor(level)) {
+ forcedLog(logger, level,
+ format(pattern, toArray(arg0, arg1, arg2)));
}
}
/**
- * Log a parameterized message at error level.
+ * Log a parameterized message at specified level.
* @param logger logger, may not be null.
* @param pattern pattern, may be null.
+ * @param level level, may not be null.
* @param arg0 a value to be formatted and substituted.
* @param arg1 a value to be formatted and substituted.
* @param arg2 a value to be formatted and substituted.
* @param arg3 a value to be formatted and substituted.
*/
- public static void error(final Logger logger, final String pattern,
+ public static void log(final Logger logger,
+ final Level level,
+ final String pattern,
final Object arg0, final Object arg1, final Object arg2,
final Object arg3) {
- if ((pattern != null) && logger.isEnabledFor(Level.ERROR)) {
- logger.error(format(pattern, new Object[] { arg0, arg1, arg2, arg3 }));
- }
- }
-
- /**
- * Log a parameterized message at fatal level.
- * @param logger logger, may not be null.
- * @param pattern pattern, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void fatal(final Logger logger, final String pattern,
- final boolean argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.FATAL)) {
- logger.fatal(format(pattern, valueOf(argument)));
- }
- }
-
- /**
- * Log a parameterized message at fatal level.
- * @param logger logger, may not be null.
- * @param pattern pattern, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void fatal(final Logger logger, final String pattern,
- final char argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.FATAL)) {
- logger.fatal(format(pattern, new Character(argument)));
- }
- }
-
- /**
- * Log a parameterized message at fatal level.
- * @param logger logger, may not be null.
- * @param pattern pattern, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void fatal(final Logger logger, final String pattern,
- final byte argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.FATAL)) {
- logger.fatal(format(pattern, new Byte(argument)));
- }
- }
-
- /**
- * Log a parameterized message at fatal level.
- * @param logger logger, may not be null.
- * @param pattern pattern, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void fatal(final Logger logger, final String pattern,
- final short argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.FATAL)) {
- logger.fatal(format(pattern, new Short(argument)));
- }
- }
-
- /**
- * Log a parameterized message at fatal level.
- * @param logger logger, may not be null.
- * @param pattern pattern, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void fatal(final Logger logger, final String pattern,
- final int argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.FATAL)) {
- logger.fatal(format(pattern, new Integer(argument)));
- }
- }
-
- /**
- * Log a parameterized message at fatal level.
- * @param logger logger, may not be null.
- * @param pattern pattern, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void fatal(final Logger logger, final String pattern,
- final long argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.FATAL)) {
- logger.fatal(format(pattern, new Long(argument)));
- }
- }
-
- /**
- * Log a parameterized message at fatal level.
- * @param logger logger, may not be null.
- * @param pattern pattern, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void fatal(final Logger logger, final String pattern,
- final float argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.FATAL)) {
- logger.fatal(format(pattern, new Float(argument)));
- }
- }
-
- /**
- * Log a parameterized message at fatal level.
- * @param logger logger, may not be null.
- * @param pattern pattern, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void fatal(final Logger logger, final String pattern,
- final double argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.FATAL)) {
- logger.fatal(format(pattern, new Double(argument)));
- }
- }
-
- /**
- * Log a parameterized message at fatal level.
- * @param logger logger, may not be null.
- * @param pattern pattern, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void fatal(final Logger logger, final String pattern,
- final Object argument) {
- if ((pattern != null) && logger.isEnabledFor(Level.FATAL)) {
- logger.fatal(format(pattern, argument));
- }
- }
-
- /**
- * Log a parameterized message at fatal level.
- * @param logger logger, may not be null.
- * @param pattern pattern, may be null.
- * @param arg0 a value to be formatted and substituted.
- * @param arg1 a value to be formatted and substituted.
- */
- public static void fatal(final Logger logger, final String pattern,
- final Object arg0, final Object arg1) {
- if ((pattern != null) && logger.isEnabledFor(Level.FATAL)) {
- logger.fatal(format(pattern, new Object[] { arg0, arg1 }));
- }
- }
-
- /**
- * Log a parameterized message at fatal level.
- * @param logger logger, may not be null.
- * @param pattern pattern, may be null.
- * @param arg0 a value to be formatted and substituted.
- * @param arg1 a value to be formatted and substituted.
- * @param arg2 a value to be formatted and substituted.
- */
- public static void fatal(final Logger logger, final String pattern,
- final Object arg0, final Object arg1, final Object arg2) {
- if ((pattern != null) && logger.isEnabledFor(Level.FATAL)) {
- logger.fatal(format(pattern, new Object[] { arg0, arg1, arg2 }));
- }
- }
-
- /**
- * Log a parameterized message at fatal level.
- * @param logger logger, may not be null.
- * @param pattern pattern, may be null.
- * @param arg0 a value to be formatted and substituted.
- * @param arg1 a value to be formatted and substituted.
- * @param arg2 a value to be formatted and substituted.
- * @param arg3 a value to be formatted and substituted.
- */
- public static void fatal(final Logger logger, final String pattern,
- final Object arg0, final Object arg1, final Object arg2,
- final Object arg3) {
- if ((pattern != null) && logger.isEnabledFor(Level.FATAL)) {
- logger.fatal(format(pattern, new Object[] { arg0, arg1, arg2, arg3 }));
- }
- }
-
- /**
- * Log a parameterized message at debug level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param arguments an array of arguments to be formatted and substituted.
- */
- public static void trace(final Logger logger, final ResourceBundle bundle,
- final String key, final Object[] arguments) {
- if ((bundle != null) && (key != null) && logger.isTraceEnabled()) {
- logger.trace(format(getPattern(bundle, key), arguments));
- }
- }
-
- /**
- * Log a parameterized message at debug level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param arguments an array of arguments to be formatted and substituted.
- */
- public static void debug(final Logger logger, final ResourceBundle bundle,
- final String key, final Object[] arguments) {
- if ((bundle != null) && (key != null) && logger.isDebugEnabled()) {
- logger.debug(format(getPattern(bundle, key), arguments));
- }
- }
-
- /**
- * Log a parameterized message at info level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param arguments an array of arguments to be formatted and substituted.
- */
- public static void info(final Logger logger, final ResourceBundle bundle,
- final String key, final Object[] arguments) {
- if ((bundle != null) && (key != null) && logger.isInfoEnabled()) {
- logger.info(format(getPattern(bundle, key), arguments));
- }
- }
-
- /**
- * Log a parameterized message at warn level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param arguments an array of arguments to be formatted and substituted.
- */
- public static void warn(final Logger logger, final ResourceBundle bundle,
- final String key, final Object[] arguments) {
- if ((bundle != null) && (key != null)
- && logger.isEnabledFor(Level.WARN)) {
- logger.warn(format(getPattern(bundle, key), arguments));
- }
- }
-
- /**
- * Log a parameterized message at error level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param arguments an array of arguments to be formatted and substituted.
- */
- public static void error(final Logger logger, final ResourceBundle bundle,
- final String key, final Object[] arguments) {
- if ((bundle != null) && (key != null)
- && logger.isEnabledFor(Level.ERROR)) {
- logger.error(format(getPattern(bundle, key), arguments));
- }
- }
-
- /**
- * Log a parameterized message at fatal level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param arguments an array of arguments to be formatted and substituted.
- */
- public static void fatal(final Logger logger, final ResourceBundle bundle,
- final String key, final Object[] arguments) {
- if ((bundle != null) && (key != null)
- && logger.isEnabledFor(Level.FATAL)) {
- logger.fatal(format(getPattern(bundle, key), arguments));
- }
- }
-
- /**
- * Log a parameterized message at trace level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void trace(final Logger logger, final ResourceBundle bundle,
- final String key, final boolean argument) {
- if ((bundle != null) && (key != null) && logger.isTraceEnabled()) {
- logger.trace(format(getPattern(bundle, key),
- valueOf(argument)));
- }
- }
-
- /**
- * Log a parameterized message at trace level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void trace(final Logger logger, final ResourceBundle bundle,
- final String key, final char argument) {
- if ((bundle != null) && (key != null) && logger.isTraceEnabled()) {
- logger.trace(
- format(getPattern(bundle, key), new Character(argument)));
- }
- }
-
- /**
- * Log a parameterized message at trace level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void trace(final Logger logger, final ResourceBundle bundle,
- final String key, final byte argument) {
- if ((bundle != null) && (key != null) && logger.isTraceEnabled()) {
- logger.trace(format(getPattern(bundle, key), new Byte(argument)));
- }
- }
-
- /**
- * Log a parameterized message at trace level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void trace(final Logger logger, final ResourceBundle bundle,
- final String key, final short argument) {
- if ((bundle != null) && (key != null) && logger.isTraceEnabled()) {
- logger.trace(format(getPattern(bundle, key), new Short(argument)));
- }
- }
-
- /**
- * Log a parameterized message at trace level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void trace(final Logger logger, final ResourceBundle bundle,
- final String key, final int argument) {
- if ((bundle != null) && (key != null) && logger.isTraceEnabled()) {
- logger.trace(format(getPattern(bundle, key), new Integer(argument)));
- }
- }
-
- /**
- * Log a parameterized message at trace level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void trace(final Logger logger, final ResourceBundle bundle,
- final String key, final long argument) {
- if ((bundle != null) && (key != null) && logger.isTraceEnabled()) {
- logger.trace(format(getPattern(bundle, key), new Long(argument)));
- }
- }
-
- /**
- * Log a parameterized message at trace level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void trace(final Logger logger, final ResourceBundle bundle,
- final String key, final float argument) {
- if ((bundle != null) && (key != null) && logger.isTraceEnabled()) {
- logger.trace(format(getPattern(bundle, key), new Float(argument)));
- }
- }
-
- /**
- * Log a parameterized message at trace level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void trace(final Logger logger, final ResourceBundle bundle,
- final String key, final double argument) {
- if ((bundle != null) && (key != null) && logger.isTraceEnabled()) {
- logger.trace(format(getPattern(bundle, key), new Double(argument)));
- }
- }
-
- /**
- * Log a parameterized message at trace level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void trace(final Logger logger, final ResourceBundle bundle,
- final String key, final Object argument) {
- if ((bundle != null) && (key != null) && logger.isTraceEnabled()) {
- logger.trace(format(getPattern(bundle, key), argument));
- }
- }
-
- /**
- * Log a parameterized message at trace level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param arg0 a value to be formatted and substituted.
- * @param arg1 a value to be formatted and substituted.
- */
- public static void trace(final Logger logger, final ResourceBundle bundle,
- final String key, final Object arg0, final Object arg1) {
- if ((bundle != null) && (key != null) && logger.isTraceEnabled()) {
- logger.trace(format(getPattern(bundle, key),
- new Object[] { arg0, arg1 }));
- }
- }
-
- /**
- * Log a parameterized message at trace level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param arg0 a value to be formatted and substituted.
- * @param arg1 a value to be formatted and substituted.
- * @param arg2 a value to be formatted and substituted.
- */
- public static void trace(final Logger logger, final ResourceBundle bundle,
- final String key, final Object arg0, final Object arg1,
- final Object arg2) {
- if ((bundle != null) && (key != null) && logger.isTraceEnabled()) {
- logger.trace(format(getPattern(bundle, key),
- new Object[] { arg0, arg1, arg2 }));
- }
- }
-
- /**
- * Log a parameterized message at trace level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param arg0 a value to be formatted and substituted.
- * @param arg1 a value to be formatted and substituted.
- * @param arg2 a value to be formatted and substituted.
- * @param arg3 a value to be formatted and substituted.
- */
- public static void trace(final Logger logger, final ResourceBundle bundle,
- final String key, final Object arg0, final Object arg1,
- final Object arg2, final Object arg3) {
- if ((bundle != null) && (key != null) && logger.isTraceEnabled()) {
- logger.trace(format(getPattern(bundle, key),
- new Object[] { arg0, arg1, arg2, arg3 }));
- }
- }
-
- /**
- * Log a parameterized message at debug level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void debug(final Logger logger, final ResourceBundle bundle,
- final String key, final boolean argument) {
- if ((bundle != null) && (key != null) && logger.isDebugEnabled()) {
- logger.debug(format(getPattern(bundle, key),
- valueOf(argument)));
- }
- }
-
- /**
- * Log a parameterized message at debug level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void debug(final Logger logger, final ResourceBundle bundle,
- final String key, final char argument) {
- if ((bundle != null) && (key != null) && logger.isDebugEnabled()) {
- logger.debug(format(getPattern(bundle, key), new Character(argument)));
- }
- }
-
- /**
- * Log a parameterized message at debug level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void debug(final Logger logger, final ResourceBundle bundle,
- final String key, final byte argument) {
- if ((bundle != null) && (key != null) && logger.isDebugEnabled()) {
- logger.debug(format(getPattern(bundle, key), new Byte(argument)));
- }
- }
-
- /**
- * Log a parameterized message at debug level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void debug(final Logger logger, final ResourceBundle bundle,
- final String key, final short argument) {
- if ((bundle != null) && (key != null) && logger.isDebugEnabled()) {
- logger.debug(format(getPattern(bundle, key), new Short(argument)));
- }
- }
-
- /**
- * Log a parameterized message at debug level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void debug(final Logger logger, final ResourceBundle bundle,
- final String key, final int argument) {
- if ((bundle != null) && (key != null) && logger.isDebugEnabled()) {
- logger.debug(format(getPattern(bundle, key), new Integer(argument)));
- }
- }
-
- /**
- * Log a parameterized message at debug level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void debug(final Logger logger, final ResourceBundle bundle,
- final String key, final long argument) {
- if ((bundle != null) && (key != null) && logger.isDebugEnabled()) {
- logger.debug(format(getPattern(bundle, key), new Long(argument)));
- }
- }
-
- /**
- * Log a parameterized message at debug level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void debug(final Logger logger, final ResourceBundle bundle,
- final String key, final float argument) {
- if ((bundle != null) && (key != null) && logger.isDebugEnabled()) {
- logger.debug(format(getPattern(bundle, key), new Float(argument)));
- }
- }
-
- /**
- * Log a parameterized message at debug level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void debug(final Logger logger, final ResourceBundle bundle,
- final String key, final double argument) {
- if ((bundle != null) && (key != null) && logger.isDebugEnabled()) {
- logger.debug(format(getPattern(bundle, key), new Double(argument)));
- }
- }
-
- /**
- * Log a parameterized message at debug level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void debug(final Logger logger, final ResourceBundle bundle,
- final String key, final Object argument) {
- if ((bundle != null) && (key != null) && logger.isDebugEnabled()) {
- logger.debug(format(getPattern(bundle, key), argument));
- }
- }
-
- /**
- * Log a parameterized message at debug level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param arg0 a value to be formatted and substituted.
- * @param arg1 a value to be formatted and substituted.
- */
- public static void debug(final Logger logger, final ResourceBundle bundle,
- final String key, final Object arg0, final Object arg1) {
- if ((bundle != null) && (key != null) && logger.isDebugEnabled()) {
- logger.debug(format(getPattern(bundle, key),
- new Object[] { arg0, arg1 }));
- }
- }
-
- /**
- * Log a parameterized message at debug level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param arg0 a value to be formatted and substituted.
- * @param arg1 a value to be formatted and substituted.
- * @param arg2 a value to be formatted and substituted.
- */
- public static void debug(final Logger logger, final ResourceBundle bundle,
- final String key, final Object arg0, final Object arg1,
- final Object arg2) {
- if ((bundle != null) && (key != null) && logger.isDebugEnabled()) {
- logger.debug(format(getPattern(bundle, key),
- new Object[] { arg0, arg1, arg2 }));
- }
- }
-
- /**
- * Log a parameterized message at debug level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param arg0 a value to be formatted and substituted.
- * @param arg1 a value to be formatted and substituted.
- * @param arg2 a value to be formatted and substituted.
- * @param arg3 a value to be formatted and substituted.
- */
- public static void debug(final Logger logger, final ResourceBundle bundle,
- final String key, final Object arg0, final Object arg1,
- final Object arg2, final Object arg3) {
- if ((bundle != null) && (key != null) && logger.isDebugEnabled()) {
- logger.debug(format(getPattern(bundle, key),
- new Object[] { arg0, arg1, arg2, arg3 }));
- }
- }
-
- /**
- * Log a parameterized message at info level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void info(final Logger logger, final ResourceBundle bundle,
- final String key, final boolean argument) {
- if ((bundle != null) && (key != null) && logger.isInfoEnabled()) {
- logger.info(format(getPattern(bundle, key),
- valueOf(argument)));
- }
- }
-
- /**
- * Log a parameterized message at info level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void info(final Logger logger, final ResourceBundle bundle,
- final String key, final char argument) {
- if ((bundle != null) && (key != null) && logger.isInfoEnabled()) {
- logger.info(format(getPattern(bundle, key), new Character(argument)));
- }
- }
-
- /**
- * Log a parameterized message at info level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void info(final Logger logger, final ResourceBundle bundle,
- final String key, final byte argument) {
- if ((bundle != null) && (key != null) && logger.isInfoEnabled()) {
- logger.info(format(getPattern(bundle, key), new Byte(argument)));
- }
- }
-
- /**
- * Log a parameterized message at info level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void info(final Logger logger, final ResourceBundle bundle,
- final String key, final short argument) {
- if ((bundle != null) && (key != null) && logger.isInfoEnabled()) {
- logger.info(format(getPattern(bundle, key), new Short(argument)));
- }
- }
-
- /**
- * Log a parameterized message at info level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void info(final Logger logger, final ResourceBundle bundle,
- final String key, final int argument) {
- if ((bundle != null) && (key != null) && logger.isInfoEnabled()) {
- logger.info(format(getPattern(bundle, key), new Integer(argument)));
- }
- }
-
- /**
- * Log a parameterized message at info level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void info(final Logger logger, final ResourceBundle bundle,
- final String key, final long argument) {
- if ((bundle != null) && (key != null) && logger.isInfoEnabled()) {
- logger.info(format(getPattern(bundle, key), new Long(argument)));
- }
- }
-
- /**
- * Log a parameterized message at info level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void info(final Logger logger, final ResourceBundle bundle,
- final String key, final float argument) {
- if ((bundle != null) && (key != null) && logger.isInfoEnabled()) {
- logger.info(format(getPattern(bundle, key), new Float(argument)));
- }
- }
-
- /**
- * Log a parameterized message at info level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void info(final Logger logger, final ResourceBundle bundle,
- final String key, final double argument) {
- if ((bundle != null) && (key != null) && logger.isInfoEnabled()) {
- logger.info(format(getPattern(bundle, key), new Double(argument)));
- }
- }
-
- /**
- * Log a parameterized message at info level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void info(final Logger logger, final ResourceBundle bundle,
- final String key, final Object argument) {
- if ((bundle != null) && (key != null) && logger.isInfoEnabled()) {
- logger.info(format(getPattern(bundle, key), argument));
- }
- }
-
- /**
- * Log a parameterized message at info level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param arg0 a value to be formatted and substituted.
- * @param arg1 a value to be formatted and substituted.
- */
- public static void info(final Logger logger, final ResourceBundle bundle,
- final String key, final Object arg0, final Object arg1) {
- if ((bundle != null) && (key != null) && logger.isInfoEnabled()) {
- logger.info(format(getPattern(bundle, key),
- new Object[] { arg0, arg1 }));
- }
- }
-
- /**
- * Log a parameterized message at info level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param arg0 a value to be formatted and substituted.
- * @param arg1 a value to be formatted and substituted.
- * @param arg2 a value to be formatted and substituted.
- */
- public static void info(final Logger logger, final ResourceBundle bundle,
- final String key, final Object arg0, final Object arg1,
- final Object arg2) {
- if ((bundle != null) && (key != null) && logger.isInfoEnabled()) {
- logger.info(format(getPattern(bundle, key),
- new Object[] { arg0, arg1, arg2 }));
- }
- }
-
- /**
- * Log a parameterized message at info level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param arg0 a value to be formatted and substituted.
- * @param arg1 a value to be formatted and substituted.
- * @param arg2 a value to be formatted and substituted.
- * @param arg3 a value to be formatted and substituted.
- */
- public static void info(final Logger logger, final ResourceBundle bundle,
- final String key, final Object arg0, final Object arg1,
- final Object arg2, final Object arg3) {
- if ((bundle != null) && (key != null) && logger.isInfoEnabled()) {
- logger.info(format(getPattern(bundle, key),
- new Object[] { arg0, arg1, arg2, arg3 }));
- }
- }
-
- /**
- * Log a parameterized message at warn level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void warn(final Logger logger, final ResourceBundle bundle,
- final String key, final boolean argument) {
- if ((bundle != null) && (key != null)
- && logger.isEnabledFor(Level.WARN)) {
- logger.warn(format(getPattern(bundle, key),
- valueOf(argument)));
- }
- }
-
- /**
- * Log a parameterized message at warn level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void warn(final Logger logger, final ResourceBundle bundle,
- final String key, final char argument) {
- if ((bundle != null) && (key != null)
- && logger.isEnabledFor(Level.WARN)) {
- logger.warn(format(getPattern(bundle, key), new Character(argument)));
- }
- }
-
- /**
- * Log a parameterized message at warn level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void warn(final Logger logger, final ResourceBundle bundle,
- final String key, final byte argument) {
- if ((bundle != null) && (key != null)
- && logger.isEnabledFor(Level.WARN)) {
- logger.warn(format(getPattern(bundle, key), new Byte(argument)));
- }
- }
-
- /**
- * Log a parameterized message at warn level.
- * @param logger logger, may not be null.
- * @param bundle resource bundle, may be null.
- * @param key key for pattern in resource bundle, may be null.
- * @param argument a value to be formatted and substituted.
- */
- public static void warn(final Logger logger, final ResourceBundle bundle,
- final String key, final short argument) {
- if ((bundle != null) && (key != null)
- && logger.isEnabledFor(Level.WARN)) {
[... 813 lines stripped ...]
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org