Search in sources :

Example 1 with FormattingTuple

use of org.slf4j.helpers.FormattingTuple in project hive by apache.

the class TestLogger method trace.

@Override
public void trace(String format, Object[] argArray) {
    FormattingTuple ft = MessageFormatter.arrayFormat(format, argArray);
    log(LEVEL.TRACE, ft.getMessage(), ft.getThrowable());
}
Also used : FormattingTuple(org.slf4j.helpers.FormattingTuple)

Example 2 with FormattingTuple

use of org.slf4j.helpers.FormattingTuple in project hive by apache.

the class TestLogger method warn.

@Override
public void warn(String format, Object[] argArray) {
    FormattingTuple ft = MessageFormatter.arrayFormat(format, argArray);
    log(LEVEL.WARN, ft.getMessage(), ft.getThrowable());
}
Also used : FormattingTuple(org.slf4j.helpers.FormattingTuple)

Example 3 with FormattingTuple

use of org.slf4j.helpers.FormattingTuple in project ACS by ACS-Community.

the class JDK14LoggerAdapter method warn.

/**
   * Log a message at level WARNING according to the specified format and
   * arguments.
   * 
   * <p>
   * This form avoids superfluous object creation when the logger is disabled
   * for the WARNING level.
   * </p>
   * 
   * @param format
   *          the format string
   * @param argArray
   *          an array of arguments
   */
public void warn(String format, Object... argArray) {
    if (logger.isLoggable(Level.WARNING)) {
        FormattingTuple ft = MessageFormatter.arrayFormat(format, argArray);
        log(SELF, Level.WARNING, ft.getMessage(), ft.getThrowable());
    }
}
Also used : FormattingTuple(org.slf4j.helpers.FormattingTuple)

Example 4 with FormattingTuple

use of org.slf4j.helpers.FormattingTuple in project ACS by ACS-Community.

the class JDK14LoggerAdapter method info.

/**
   * Log a message at the INFO level according to the specified format and
   * arguments.
   * 
   * <p>
   * This form avoids superfluous object creation when the logger is disabled
   * for the INFO level.
   * </p>
   * 
   * @param format
   *          the format string
   * @param arg1
   *          the first argument
   * @param arg2
   *          the second argument
   */
public void info(String format, Object arg1, Object arg2) {
    if (logger.isLoggable(Level.INFO)) {
        FormattingTuple ft = MessageFormatter.format(format, arg1, arg2);
        log(SELF, Level.INFO, ft.getMessage(), ft.getThrowable());
    }
}
Also used : FormattingTuple(org.slf4j.helpers.FormattingTuple)

Example 5 with FormattingTuple

use of org.slf4j.helpers.FormattingTuple in project gradle by gradle.

the class OutputEventListenerBackedLogger method log.

private void log(LogLevel logLevel, Throwable throwable, String format, Object[] args) {
    FormattingTuple tuple = MessageFormatter.arrayFormat(format, args);
    Throwable loggedThrowable = throwable == null ? tuple.getThrowable() : throwable;
    log(logLevel, loggedThrowable, tuple.getMessage());
}
Also used : FormattingTuple(org.slf4j.helpers.FormattingTuple)

Aggregations

FormattingTuple (org.slf4j.helpers.FormattingTuple)61 LocationAwareLogger (org.slf4j.spi.LocationAwareLogger)5 LogRecord (java.util.logging.LogRecord)4 LogTask (alien4cloud.topology.task.LogTask)3 LogCapture (org.opendaylight.infrautils.testutils.LogCapture)2 DolphinLoggerBridge (com.canoo.platform.logging.spi.DolphinLoggerBridge)1 LogMessage (com.canoo.platform.logging.spi.LogMessage)1 StringReader (java.io.StringReader)1 StringWriter (java.io.StringWriter)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)1 JsonObject (javax.json.JsonObject)1 Test (org.junit.Test)1