Search in sources :

Example 6 with FormattingTuple

use of org.slf4j.helpers.FormattingTuple in project hive by apache.

the class TestLogger method trace.

@Override
public void trace(String format, Object arg1, Object arg2) {
    FormattingTuple ft = MessageFormatter.format(format, arg1, arg2);
    log(LEVEL.TRACE, ft.getMessage(), ft.getThrowable());
}
Also used : FormattingTuple(org.slf4j.helpers.FormattingTuple)

Example 7 with FormattingTuple

use of org.slf4j.helpers.FormattingTuple in project hive by apache.

the class TestLogger method info.

@Override
public void info(String format, Object arg1, Object arg2) {
    FormattingTuple ft = MessageFormatter.format(format, arg1, arg2);
    log(LEVEL.INFO, ft.getMessage(), ft.getThrowable());
}
Also used : FormattingTuple(org.slf4j.helpers.FormattingTuple)

Example 8 with FormattingTuple

use of org.slf4j.helpers.FormattingTuple in project sling by apache.

the class TracerContext method logWithLoggerName.

private FormattingTuple logWithLoggerName(String loggerName, String format, Object... params) {
    FormattingTuple tuple = MessageFormatter.arrayFormat(format, params);
    String msg = tuple.getMessage();
    msg = "[" + loggerName + "] " + msg;
    if (progressTracker == null) {
        if (buffer == null) {
            buffer = new CyclicBuffer<String>(LOG_BUFFER_SIZE);
        }
        buffer.add(msg);
    } else {
        progressTracker.log(msg);
    }
    return tuple;
}
Also used : FormattingTuple(org.slf4j.helpers.FormattingTuple)

Example 9 with FormattingTuple

use of org.slf4j.helpers.FormattingTuple in project hive by apache.

the class TestLogger method error.

@Override
public void error(String format, Object arg) {
    FormattingTuple ft = MessageFormatter.format(format, arg);
    log(LEVEL.ERROR, ft.getMessage(), ft.getThrowable());
}
Also used : FormattingTuple(org.slf4j.helpers.FormattingTuple)

Example 10 with FormattingTuple

use of org.slf4j.helpers.FormattingTuple in project openzaly by akaxincom.

the class LogUtils method info.

public static void info(org.apache.log4j.Logger logger, String messagePattern, Object object) {
    FormattingTuple format = MessageFormatter.format(messagePattern, object);
    logger.info(format.getMessage());
}
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