Refine search
private void writeLog(Marker marker, int level, String format, Object[] args, Throwable exception) { String message = format; if (args != null && args.length > 0) { FormattingTuple formatted = MessageFormatter.arrayFormat(format, args); if (exception == null && formatted.getThrowable() != null) { exception = formatted.getThrowable(); } message = formatted.getMessage(); } logger.log(marker, fqcn, level, addPrefix(message), null, exception); } }
/** * Log a message at level DEBUG according to the specified format and * argument. * * <p> * This form avoids superfluous object creation when the logger is disabled * for level DEBUG. * </p> * * @param format * the format string * @param arg * the argument */ public void debug(String format, Object arg) { if (logger.isDebugEnabled()) { FormattingTuple ft = MessageFormatter.format(format, arg); logger.log(FQCN, Level.DEBUG, ft.getMessage(), ft.getThrowable()); } }
/** * Log a message at level INFO according to the specified format and argument. * * <p> * This form avoids superfluous object creation when the logger is disabled * for the INFO level. * </p> * * @param format * the format string * @param arg * the argument */ public void info(String format, Object arg) { if (logger.isInfoEnabled()) { FormattingTuple ft = MessageFormatter.format(format, arg); logger.log(FQCN, Level.INFO, ft.getMessage(), ft.getThrowable()); } }
/** * 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 arguments an array of arguments */ public void debug(String format, Object... arguments) { if (logger.isDebugEnabled()) { FormattingTuple ft = MessageFormatter.arrayFormat(format, arguments); logger.log(FQCN, Level.DEBUG, ft.getMessage(), ft.getThrowable()); } }
/** * 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. * </p> * * @param format * the format string * @param arg * the argument */ public void error(String format, Object arg) { if (logger.isEnabledFor(Level.ERROR)) { FormattingTuple ft = MessageFormatter.format(format, arg); logger.log(FQCN, Level.ERROR, ft.getMessage(), ft.getThrowable()); } }
/** * Log a message at level WARN 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 argArray * an array of arguments */ public void warn(String format, Object... argArray) { if (logger.isEnabledFor(Level.WARN)) { FormattingTuple ft = MessageFormatter.arrayFormat(format, argArray); logger.log(FQCN, Level.WARN, ft.getMessage(), ft.getThrowable()); } }
/** * Log a message at the WARN level according to the specified format and * argument. * * <p> * This form avoids superfluous object creation when the logger is disabled * for the WARN level. * </p> * * @param format * the format string * @param arg * the argument */ public void warn(String format, Object arg) { if (logger.isEnabledFor(Level.WARN)) { FormattingTuple ft = MessageFormatter.format(format, arg); logger.log(FQCN, Level.WARN, ft.getMessage(), ft.getThrowable()); } }
/** * 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 */ public void info(String format, Object... argArray) { if (logger.isInfoEnabled()) { FormattingTuple ft = MessageFormatter.arrayFormat(format, argArray); logger.log(FQCN, Level.INFO, ft.getMessage(), ft.getThrowable()); } }
/** * 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.isInfoEnabled()) { FormattingTuple ft = MessageFormatter.format(format, arg1, arg2); logger.log(FQCN, Level.INFO, ft.getMessage(), ft.getThrowable()); } }
/** * Log a message at level ERROR according to the specified format and * arguments. * * <p> * This form avoids superfluous object creation when the logger is disabled * for the ERROR level. * </p> * * @param format * the format string * @param argArray * an array of arguments */ public void error(String format, Object... argArray) { if (logger.isEnabledFor(Level.ERROR)) { FormattingTuple ft = MessageFormatter.arrayFormat(format, argArray); logger.log(FQCN, Level.ERROR, ft.getMessage(), ft.getThrowable()); } }
/** * 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 */ public void warn(String format, Object arg1, Object arg2) { if (logger.isEnabledFor(Level.WARN)) { FormattingTuple ft = MessageFormatter.format(format, arg1, arg2); logger.log(FQCN, Level.WARN, ft.getMessage(), ft.getThrowable()); } }
/** * 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 arguments * an array of arguments */ public void trace(String format, Object... arguments) { if (isTraceEnabled()) { FormattingTuple ft = MessageFormatter.arrayFormat(format, arguments); logger.log(FQCN, traceCapable ? Level.TRACE : Level.DEBUG, ft.getMessage(), ft.getThrowable()); } }
/** * Log a message at the ERROR level according to the specified format and * arguments. * * <p> * This form avoids superfluous object creation when the logger is disabled * for the ERROR level. * </p> * * @param format * the format string * @param arg1 * the first argument * @param arg2 * the second argument */ public void error(String format, Object arg1, Object arg2) { if (logger.isEnabledFor(Level.ERROR)) { FormattingTuple ft = MessageFormatter.format(format, arg1, arg2); logger.log(FQCN, Level.ERROR, ft.getMessage(), ft.getThrowable()); } }
private void log(final int level, final org.slf4j.helpers.FormattingTuple tuple) { logger.log(null, FQCN, level, tuple.getMessage(), tuple.getArgArray(), tuple.getThrowable()); }
/** * 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 */ public void debug(String format, Object arg1, Object arg2) { if (logger.isDebugEnabled()) { FormattingTuple ft = MessageFormatter.format(format, arg1, arg2); logger.log(FQCN, Level.DEBUG, ft.getMessage(), ft.getThrowable()); } }
/** * For formatted messages, first substitute arguments and then log. * * @param level * @param format * @param arguments * a list of 3 ore more arguments */ private void formatAndLog(int level, String format, Object... arguments) { if (!isLevelEnabled(level)) { return; } FormattingTuple tp = MessageFormatter.arrayFormat(format, arguments); log(level, tp.getMessage(), tp.getThrowable()); }
/** * Log a message at level TRACE according to the specified format and * argument. * * <p> * This form avoids superfluous object creation when the logger is disabled * for level TRACE. * </p> * * @param format * the format string * @param arg * the argument */ public void trace(String format, Object arg) { if (isTraceEnabled()) { FormattingTuple ft = MessageFormatter.format(format, arg); logger.log(FQCN, traceCapable ? Level.TRACE : Level.DEBUG, ft.getMessage(), ft.getThrowable()); } }
private void log(final int level, final org.slf4j.helpers.FormattingTuple tuple) { logger.log(null, FQCN, level, tuple.getMessage(), tuple.getArgArray(), tuple.getThrowable()); }
/** * 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 */ public void trace(String format, Object arg1, Object arg2) { if (isTraceEnabled()) { FormattingTuple ft = MessageFormatter.format(format, arg1, arg2); logger.log(FQCN, traceCapable ? Level.TRACE : Level.DEBUG, ft.getMessage(), ft.getThrowable()); } }
LocationAwareLogger l = (LocationAwareLogger) logger; FormattingTuple ft = MessageFormatter.arrayFormat(msg, parameters); l.log(null, FQCN, level, ft.getMessage(), null, ft.getThrowable());