Ejemplo n.º 1
0
 /**
  * This method implements LocationAwareLogger.log
  *
  * <p>The caller passes in it's own Fully Qualified Class Name (fqcn).
  *
  * @param marker
  * @param fqcn the fully qualified class name (FQCN) of the <b>caller</b>
  * @param level Integer representation of the log level as defined in LocationAwareLogger
  * @param message the message as a format string
  * @param argArray an array of arguments to use in the message format string
  * @param t the throwable to log
  */
 public void log(
     Marker marker, String fqcn, int level, String message, Object[] argArray, Throwable t) {
   switch (level) {
     case (TRACE_INT):
       if (m_delegate.isTraceEnabled()) {
         FormattingTuple tuple = MessageFormatter.arrayFormat(message, argArray);
         m_delegate.trace(tuple.getMessage(), t, fqcn);
       }
       break;
     case (DEBUG_INT):
       if (m_delegate.isDebugEnabled()) {
         FormattingTuple tuple = MessageFormatter.arrayFormat(message, argArray);
         m_delegate.debug(tuple.getMessage(), t, fqcn);
       }
       break;
     case (INFO_INT):
       if (m_delegate.isInfoEnabled()) {
         FormattingTuple tuple = MessageFormatter.arrayFormat(message, argArray);
         m_delegate.inform(tuple.getMessage(), t, fqcn);
       }
       break;
     case (WARN_INT):
       if (m_delegate.isWarnEnabled()) {
         FormattingTuple tuple = MessageFormatter.arrayFormat(message, argArray);
         m_delegate.warn(tuple.getMessage(), t, fqcn);
       }
       break;
     case (ERROR_INT):
       if (m_delegate.isErrorEnabled()) {
         FormattingTuple tuple = MessageFormatter.arrayFormat(message, argArray);
         m_delegate.error(tuple.getMessage(), t, fqcn);
       }
       break;
     default:
       break;
   }
 }
Ejemplo n.º 2
0
 /**
  * This method is similar to {@link #warn(String, Object, Object)} method except that the marker
  * data is also taken into consideration.
  *
  * @param marker the marker data specific to this log statement
  * @param format the format string
  * @param arg1 the first argument
  * @param arg2 the second argument
  */
 public void warn(Marker marker, String format, Object arg1, Object arg2) {
   if (m_delegate.isWarnEnabled()) {
     FormattingTuple tuple = MessageFormatter.format(format, arg1, arg2);
     m_delegate.warn(tuple.getMessage(), tuple.getThrowable());
   }
 }
Ejemplo n.º 3
0
 /**
  * Log a message with the specific Marker at the WARN level.
  *
  * @param marker The marker specific to this log statement
  * @param msg the message string to be logged
  */
 public void warn(Marker marker, String msg) {
   if (m_delegate.isWarnEnabled()) {
     m_delegate.warn(msg, null);
   }
 }
Ejemplo n.º 4
0
 /**
  * Log a message at the WARN level according to the specified format and arguments.
  *
  * <p>This form avoids superfluous object creation when the logger is disabled for the WARN level.
  *
  * @param format the format string
  * @param argArray an array of arguments
  */
 public void warn(String format, Object[] argArray) {
   if (m_delegate.isWarnEnabled()) {
     FormattingTuple tuple = MessageFormatter.arrayFormat(format, argArray);
     m_delegate.warn(tuple.getMessage(), tuple.getThrowable());
   }
 }
Ejemplo n.º 5
0
 /**
  * Log a message at the DEBUG level according to the specified format and argument.
  *
  * <p>This form avoids superfluous object creation when the logger is disabled for the DEBUG
  * level.
  *
  * @param format the format string
  * @param arg the argument
  */
 public void debug(String format, Object arg) {
   if (m_delegate.isDebugEnabled()) {
     FormattingTuple tuple = MessageFormatter.format(format, arg);
     m_delegate.debug(tuple.getMessage(), tuple.getThrowable());
   }
 }
Ejemplo n.º 6
0
 /**
  * This method is similar to {@link #error(String, Object[])} method except that the marker data
  * is also taken into consideration.
  *
  * @param marker the marker data specific to this log statement
  * @param format the format string
  * @param argArray an array of arguments
  */
 public void error(Marker marker, String format, Object[] argArray) {
   if (m_delegate.isErrorEnabled()) {
     FormattingTuple tuple = MessageFormatter.arrayFormat(format, argArray);
     m_delegate.error(tuple.getMessage(), tuple.getThrowable());
   }
 }
Ejemplo n.º 7
0
 /**
  * This method is similar to {@link #info(String, Object)} method except that the marker data is
  * also taken into consideration.
  *
  * @param marker the marker data specific to this log statement
  * @param format the format string
  * @param arg the argument
  */
 public void info(Marker marker, String format, Object arg) {
   if (m_delegate.isInfoEnabled()) {
     FormattingTuple tuple = MessageFormatter.format(format, arg);
     m_delegate.inform(tuple.getMessage(), tuple.getThrowable());
   }
 }
Ejemplo n.º 8
0
 /**
  * Similar to {@link #isErrorEnabled()} method except that the marker data is also taken into
  * consideration.
  *
  * @param marker The marker data to take into consideration
  */
 public boolean isErrorEnabled(Marker marker) {
   return m_delegate.isErrorEnabled();
 }
Ejemplo n.º 9
0
 /**
  * Is the logger instance enabled for the INFO level?
  *
  * @return True if this Logger is enabled for the INFO level, false otherwise.
  */
 public boolean isInfoEnabled() {
   return m_delegate.isInfoEnabled();
 }
Ejemplo n.º 10
0
 /**
  * Log a message with the specific Marker at the INFO level.
  *
  * @param marker The marker specific to this log statement
  * @param msg the message string to be logged
  */
 public void info(Marker marker, String msg) {
   if (m_delegate.isInfoEnabled()) {
     m_delegate.inform(msg, null);
   }
 }
Ejemplo n.º 11
0
 /**
  * This method is similar to {@link #debug(String, Throwable)} method except that the marker data
  * is also taken into consideration.
  *
  * @param marker the marker data specific to this log statement
  * @param msg the message accompanying the exception
  * @param t the exception (throwable) to log
  */
 public void debug(Marker marker, String msg, Throwable t) {
   if (m_delegate.isDebugEnabled()) {
     m_delegate.debug(msg, t);
   }
 }
Ejemplo n.º 12
0
 /**
  * Log a message with the specific Marker at the DEBUG level.
  *
  * @param marker the marker data specific to this log statement
  * @param msg the message string to be logged
  */
 public void debug(Marker marker, String msg) {
   if (m_delegate.isDebugEnabled()) {
     m_delegate.debug(msg, null);
   }
 }
Ejemplo n.º 13
0
 /**
  * Similar to {@link #isDebugEnabled()} method except that the marker data is also taken into
  * account.
  *
  * @param marker The marker data to take into consideration
  */
 public boolean isDebugEnabled(Marker marker) {
   return m_delegate.isDebugEnabled();
 }
Ejemplo n.º 14
0
 /**
  * This method is similar to {@link #warn(String, Throwable)} method except that the marker data
  * is also taken into consideration.
  *
  * @param marker the marker data for this log statement
  * @param msg the message accompanying the exception
  * @param t the exception (throwable) to log
  */
 public void warn(Marker marker, String msg, Throwable t) {
   if (m_delegate.isWarnEnabled()) {
     m_delegate.warn(msg, t);
   }
 }
Ejemplo n.º 15
0
 /**
  * Is the logger instance enabled for the TRACE level?
  *
  * @return True if this Logger is enabled for the DEBUG level, false otherwise.
  */
 public boolean isTraceEnabled() {
   return m_delegate.isTraceEnabled();
 }
Ejemplo n.º 16
0
 /**
  * Log a message at the ERROR level according to the specified format and argument.
  *
  * <p>This form avoids superfluous object creation when the logger is disabled for the ERROR
  * level.
  *
  * @param format the format string
  * @param arg the argument
  */
 public void error(String format, Object arg) {
   if (m_delegate.isErrorEnabled()) {
     FormattingTuple tuple = MessageFormatter.format(format, arg);
     m_delegate.error(tuple.getMessage(), tuple.getThrowable());
   }
 }
Ejemplo n.º 17
0
 /**
  * This method is similar to {@link #info(String, Throwable)} method except that the marker data
  * is also taken into consideration.
  *
  * @param marker the marker data for this log statement
  * @param msg the message accompanying the exception
  * @param t the exception (throwable) to log
  */
 public void info(Marker marker, String msg, Throwable t) {
   if (m_delegate.isInfoEnabled()) {
     m_delegate.inform(msg, t);
   }
 }
Ejemplo n.º 18
0
 /**
  * Log a message with the specific Marker at the ERROR level.
  *
  * @param marker The marker specific to this log statement
  * @param msg the message string to be logged
  */
 public void error(Marker marker, String msg) {
   if (m_delegate.isErrorEnabled()) {
     m_delegate.error(msg, null);
   }
 }
Ejemplo n.º 19
0
 /**
  * Is the logger instance enabled for the WARN level?
  *
  * @return True if this Logger is enabled for the WARN level, false otherwise.
  */
 public boolean isWarnEnabled() {
   return m_delegate.isWarnEnabled();
 }
Ejemplo n.º 20
0
 /**
  * This method is similar to {@link #error(String, Throwable)} method except that the marker data
  * is also taken into consideration.
  *
  * @param marker the marker data specific to this log statement
  * @param msg the message accompanying the exception
  * @param t the exception (throwable) to log
  */
 public void error(Marker marker, String msg, Throwable t) {
   if (m_delegate.isErrorEnabled()) {
     m_delegate.error(msg, t);
   }
 }
Ejemplo n.º 21
0
 /**
  * Log a message at the DEBUG level.
  *
  * @param msg the message string to be logged
  */
 public void trace(String msg) {
   if (m_delegate.isTraceEnabled()) {
     m_delegate.trace(msg, null);
   }
 }
Ejemplo n.º 22
0
 /**
  * Log a message at the TRACE level according to the specified format and arguments.
  *
  * <p>This form avoids superfluous object creation when the logger is disabled for the TRACE
  * level.
  *
  * @param format the format string
  * @param arg1 the first argument
  * @param arg2 the second argument
  */
 public void trace(String format, Object arg1, Object arg2) {
   if (m_delegate.isTraceEnabled()) {
     FormattingTuple tuple = MessageFormatter.format(format, arg1, arg2);
     m_delegate.trace(tuple.getMessage(), tuple.getThrowable());
   }
 }
Ejemplo n.º 23
0
 /**
  * This method is similar to {@link #trace(String, Throwable)} method except that the marker data
  * is also taken into consideration.
  *
  * @param marker the marker data specific to this log statement
  * @param msg the message accompanying the exception
  * @param t the exception (throwable) to log
  */
 public void trace(Marker marker, String msg, Throwable t) {
   if (m_delegate.isTraceEnabled()) {
     m_delegate.trace(msg, t);
   }
 }