Search in sources :

Example 21 with FormattingTuple

use of org.slf4j.helpers.FormattingTuple in project jPOS by jpos.

the class JPOSLogger method warn.

@Override
public void warn(String format, Object arg) {
    if (isWarnEnabled()) {
        FormattingTuple ft = MessageFormatter.format(format, arg);
        log.warn(ft.getMessage());
    }
}
Also used : FormattingTuple(org.slf4j.helpers.FormattingTuple)

Example 22 with FormattingTuple

use of org.slf4j.helpers.FormattingTuple in project jPOS by jpos.

the class JPOSLogger method info.

@Override
public void info(String format, Object... arguments) {
    if (isInfoEnabled()) {
        FormattingTuple ft = MessageFormatter.arrayFormat(format, arguments);
        log.info(ft.getMessage());
    }
}
Also used : FormattingTuple(org.slf4j.helpers.FormattingTuple)

Example 23 with FormattingTuple

use of org.slf4j.helpers.FormattingTuple in project knime-core by knime.

the class NodeLoggerLoggerAdapter method trace.

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

Example 24 with FormattingTuple

use of org.slf4j.helpers.FormattingTuple in project knime-core by knime.

the class NodeLoggerLoggerAdapter method debug.

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

Example 25 with FormattingTuple

use of org.slf4j.helpers.FormattingTuple in project knime-core by knime.

the class NodeLoggerLoggerAdapter method info.

/**
 * Log a message at level INFO 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 argArray
 *          an array of arguments
 */
@Override
public void info(final String format, final Object... argArray) {
    if (m_nodeLogger.isInfoEnabled()) {
        FormattingTuple ft = MessageFormatter.arrayFormat(format, argArray);
        m_nodeLogger.info(ft.getMessage(), ft.getThrowable());
    }
}
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