use of org.slf4j.helpers.FormattingTuple in project cayenne by apache.
the class ModelerLogger method log.
/**
* Prints common message to the modeler console
*/
void log(String level, String message, Throwable throwable, AttributeSet style, Object... parameters) {
FormattingTuple tuple = MessageFormatter.arrayFormat(message, parameters);
getLogConsole().appendMessage(level, tuple.getMessage(), throwable, style);
}
use of org.slf4j.helpers.FormattingTuple in project gradle by gradle.
the class DefaultContextAwareTaskLogger 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());
}
use of org.slf4j.helpers.FormattingTuple in project metron by apache.
the class PerformanceLogger method log.
/**
* Log a message at DEBUG level according to the specified format and argument.
*
* <p>This form avoids superfluous string concatenation when the logger
* is disabled for the DEBUG level.</p>
*
* @param markName name of the marked timer to log elapsed time for
* @param format the format string
* @param arg1 first argument to the format String
* @param arg2 second argument to the format String
*/
public void log(String markName, String format, Object arg1, Object arg2) {
if (okToLog()) {
FormattingTuple formattedMessage = MessageFormatter.format(format, arg1, arg2);
log(markName, formattedMessage.getMessage());
}
}
use of org.slf4j.helpers.FormattingTuple in project jfinal by jfinal.
the class Slf4jLog method info.
public void info(String format, Object... args) {
if (isInfoEnabled()) {
FormattingTuple ft = MessageFormatter.arrayFormat(format, args);
log.log(null, callerFQCN, LocationAwareLogger.INFO_INT, ft.getMessage(), NULL_ARGS, ft.getThrowable());
}
}
use of org.slf4j.helpers.FormattingTuple in project jfinal by jfinal.
the class Slf4jLog method trace.
// -------------------------------------------------------
public void trace(String format, Object... args) {
if (isTraceEnabled()) {
FormattingTuple ft = MessageFormatter.arrayFormat(format, args);
log.log(null, callerFQCN, LocationAwareLogger.TRACE_INT, ft.getMessage(), NULL_ARGS, ft.getThrowable());
}
}
Aggregations