use of org.slf4j.helpers.FormattingTuple in project knime-core by knime.
the class NodeLoggerLoggerAdapter method warn.
/**
* 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.
* </p>
*
* @param format
* the format string
* @param arg1
* the first argument
* @param arg2
* the second argument
*/
@Override
public void warn(final String format, final Object arg1, final Object arg2) {
if (isWarnEnabled()) {
FormattingTuple ft = MessageFormatter.format(format, arg1, arg2);
m_nodeLogger.warn(ft.getMessage(), ft.getThrowable());
}
}
use of org.slf4j.helpers.FormattingTuple in project jetty.project by eclipse.
the class JettyAwareLogger method log.
private void log(Marker marker, int level, String msg, Object[] argArray, Throwable t) {
if (argArray == null) {
// Simple SLF4J Message (no args)
_logger.log(marker, FQCN, level, msg, null, t);
} else {
int loggerLevel = _logger.isTraceEnabled() ? TRACE : _logger.isDebugEnabled() ? DEBUG : _logger.isInfoEnabled() ? INFO : _logger.isWarnEnabled() ? WARN : ERROR;
if (loggerLevel <= level) {
// Don't assume downstream handles argArray properly.
// Do it the SLF4J way here to eliminate that as a bug.
FormattingTuple ft = MessageFormatter.arrayFormat(msg, argArray);
_logger.log(marker, FQCN, level, ft.getMessage(), null, t);
}
}
}
use of org.slf4j.helpers.FormattingTuple in project hive by apache.
the class TestLogger method info.
@Override
public void info(String format, Object[] argArray) {
FormattingTuple ft = MessageFormatter.arrayFormat(format, argArray);
log(LEVEL.INFO, ft.getMessage(), ft.getThrowable());
}
use of org.slf4j.helpers.FormattingTuple in project hive by apache.
the class TestLogger method debug.
@Override
public void debug(String format, Object[] argArray) {
FormattingTuple ft = MessageFormatter.arrayFormat(format, argArray);
log(LEVEL.DEBUG, ft.getMessage(), ft.getThrowable());
}
use of org.slf4j.helpers.FormattingTuple in project hive by apache.
the class TestLogger method error.
@Override
public void error(String format, Object[] argArray) {
FormattingTuple ft = MessageFormatter.arrayFormat(format, argArray);
log(LEVEL.ERROR, ft.getMessage(), ft.getThrowable());
}
Aggregations