Search in sources :

Example 56 with FormattingTuple

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

the class Slf4jLog method warn.

public void warn(String format, Object... args) {
    if (isWarnEnabled()) {
        FormattingTuple ft = MessageFormatter.arrayFormat(format, args);
        log.log(null, callerFQCN, LocationAwareLogger.WARN_INT, ft.getMessage(), NULL_ARGS, ft.getThrowable());
    }
}
Also used : FormattingTuple(org.slf4j.helpers.FormattingTuple)

Example 57 with FormattingTuple

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

the class Slf4jLog method debug.

public void debug(String format, Object... args) {
    if (isDebugEnabled()) {
        FormattingTuple ft = MessageFormatter.arrayFormat(format, args);
        log.log(null, callerFQCN, LocationAwareLogger.DEBUG_INT, ft.getMessage(), NULL_ARGS, ft.getThrowable());
    }
}
Also used : FormattingTuple(org.slf4j.helpers.FormattingTuple)

Example 58 with FormattingTuple

use of org.slf4j.helpers.FormattingTuple in project new-cloud by xie-summer.

the class JsonLogger method exit.

/**
 * Log method exit
 *
 * @param result
 *           The result of the method being exited
 */
public void exit(Object result) {
    if (instanceofLAL && logger.isTraceEnabled(ENTRY_MARKER)) {
        FormattingTuple tp = MessageFormatter.format(EXIT_MESSAGE_1, result);
        ((LocationAwareLogger) logger).log(EXIT_MARKER, FQCN, LocationAwareLogger.TRACE_INT, tp.getMessage(), new Object[] { result }, tp.getThrowable());
    }
}
Also used : LocationAwareLogger(org.slf4j.spi.LocationAwareLogger) FormattingTuple(org.slf4j.helpers.FormattingTuple)

Example 59 with FormattingTuple

use of org.slf4j.helpers.FormattingTuple in project new-cloud by xie-summer.

the class SimpleLogger method exit.

/**
 * Log method exit
 *
 * @param result The result of the method being exited
 */
public void exit(Object result) {
    if (instanceofLAL && logger.isTraceEnabled(ENTRY_MARKER)) {
        FormattingTuple tp = MessageFormatter.format(EXIT_MESSAGE_1, result);
        ((LocationAwareLogger) logger).log(EXIT_MARKER, FQCN, LocationAwareLogger.TRACE_INT, tp.getMessage(), new Object[] { result }, tp.getThrowable());
    }
}
Also used : LocationAwareLogger(org.slf4j.spi.LocationAwareLogger) FormattingTuple(org.slf4j.helpers.FormattingTuple)

Example 60 with FormattingTuple

use of org.slf4j.helpers.FormattingTuple in project infrautils by opendaylight.

the class RememberingLogger method error.

@Override
public void error(Marker marker, String format, Object... arguments) {
    if (!LogRule.getMarker().equals(marker)) {
        FormattingTuple mf = MessageFormatter.arrayFormat(format, arguments);
        ERRORS.add(new LogCapture(ERROR, mf.getMessage(), mf.getThrowable()));
    }
    super.error(marker, format, arguments);
}
Also used : LogCapture(org.opendaylight.infrautils.testutils.LogCapture) 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