Search in sources :

Example 41 with FormattingTuple

use of org.slf4j.helpers.FormattingTuple in project Javacord by BtoBastian.

the class JavacordLogger method warn.

@Override
public final void warn(String format, Object arg1) {
    FormattingTuple ft = MessageFormatter.format(format, arg1);
    LogRecord record = new LogRecord(Level.WARNING, ft.getMessage());
    record.setThrown(ft.getThrowable());
    record.setLoggerName(name);
    Logger.getLogger(name).log(record);
}
Also used : LogRecord(java.util.logging.LogRecord) FormattingTuple(org.slf4j.helpers.FormattingTuple)

Example 42 with FormattingTuple

use of org.slf4j.helpers.FormattingTuple in project Javacord by BtoBastian.

the class JavacordLogger method info.

@Override
public final void info(String format, Object... arguments) {
    FormattingTuple ft = MessageFormatter.arrayFormat(format, arguments);
    LogRecord record = new LogRecord(Level.INFO, ft.getMessage());
    record.setThrown(ft.getThrowable());
    record.setLoggerName(name);
    Logger.getLogger(name).log(record);
}
Also used : LogRecord(java.util.logging.LogRecord) FormattingTuple(org.slf4j.helpers.FormattingTuple)

Example 43 with FormattingTuple

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

the class FlowExecutionLog method error.

public void error(String message, Object... args) {
    FormattingTuple ft = MessageFormatter.arrayFormat(message, args);
    errors.add(new LogTask(ft.getMessage()));
}
Also used : FormattingTuple(org.slf4j.helpers.FormattingTuple) LogTask(alien4cloud.topology.task.LogTask)

Example 44 with FormattingTuple

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

the class FlowExecutionLog method warn.

public void warn(String message, Object... args) {
    FormattingTuple ft = MessageFormatter.arrayFormat(message, args);
    warnings.add(new LogTask(ft.getMessage()));
}
Also used : FormattingTuple(org.slf4j.helpers.FormattingTuple) LogTask(alien4cloud.topology.task.LogTask)

Example 45 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)

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