當前位置: 首頁>>代碼示例>>Java>>正文


Java FormattingTuple.getMessage方法代碼示例

本文整理匯總了Java中org.slf4j.helpers.FormattingTuple.getMessage方法的典型用法代碼示例。如果您正苦於以下問題:Java FormattingTuple.getMessage方法的具體用法?Java FormattingTuple.getMessage怎麽用?Java FormattingTuple.getMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.slf4j.helpers.FormattingTuple的用法示例。


在下文中一共展示了FormattingTuple.getMessage方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: eventToRecord

import org.slf4j.helpers.FormattingTuple; //導入方法依賴的package包/類
private LogRecord eventToRecord(LoggingEvent event, Level julLevel) {
    String format = event.getMessage();
    Object[] arguments = event.getArgumentArray();
    FormattingTuple ft = MessageFormatter.arrayFormat(format, arguments);
    if (ft.getThrowable() != null && event.getThrowable() != null) {
        throw new IllegalArgumentException("both last element in argument array and last argument are of type Throwable");
    }

    Throwable t = event.getThrowable();
    if (ft.getThrowable() != null) {
        t = ft.getThrowable();
        throw new IllegalStateException("fix above code");
    }

    LogRecord record = new LogRecord(julLevel, ft.getMessage());
    record.setLoggerName(event.getLoggerName());
    record.setMillis(event.getTimeStamp());
    record.setSourceClassName(EventConstants.NA_SUBST);
    record.setSourceMethodName(EventConstants.NA_SUBST);

    record.setThrown(t);
    return record;
}
 
開發者ID:AmadeusITGroup,項目名稱:HttpSessionReplacer,代碼行數:24,代碼來源:JDK14LoggerAdapter.java

示例2: debug

import org.slf4j.helpers.FormattingTuple; //導入方法依賴的package包/類
@Override
final public void debug(String format, Object arg1) {
    if (isDebugEnabled()) {
        FormattingTuple ft = MessageFormatter.format(format, arg1);
        LogRecord record = new LogRecord(Level.FINE, ft.getMessage());
        record.setThrown(ft.getThrowable());
        record.setLoggerName(name);
        Logger.getLogger(name).log(record);
    }
}
 
開發者ID:BtoBastian,項目名稱:Javacord,代碼行數:11,代碼來源:JavacordLogger.java

示例3: info

import org.slf4j.helpers.FormattingTuple; //導入方法依賴的package包/類
@Override
final public void info(String format, Object arg1) {
    FormattingTuple ft = MessageFormatter.format(format, arg1);
    LogRecord record = new LogRecord(Level.INFO, ft.getMessage());
    record.setThrown(ft.getThrowable());
    record.setLoggerName(name);
    Logger.getLogger(name).log(record);
}
 
開發者ID:BtoBastian,項目名稱:Javacord,代碼行數:9,代碼來源:JavacordLogger.java

示例4: warn

import org.slf4j.helpers.FormattingTuple; //導入方法依賴的package包/類
@Override
final public 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);
}
 
開發者ID:BtoBastian,項目名稱:Javacord,代碼行數:9,代碼來源:JavacordLogger.java

示例5: error

import org.slf4j.helpers.FormattingTuple; //導入方法依賴的package包/類
@Override
final public void error(String format, Object arg1) {
    FormattingTuple ft = MessageFormatter.format(format, arg1);
    LogRecord record = new LogRecord(Level.SEVERE, ft.getMessage());
    record.setThrown(ft.getThrowable());
    record.setLoggerName(name);
    Logger.getLogger(name).log(record);
}
 
開發者ID:BtoBastian,項目名稱:Javacord,代碼行數:9,代碼來源:JavacordLogger.java

示例6: at

import org.slf4j.helpers.FormattingTuple; //導入方法依賴的package包/類
public static String at(String template, Object... params) {
    FormattingTuple formatted = MessageFormatter.arrayFormat(template, params);

    return formatted.getMessage();
}
 
開發者ID:dmn1k,項目名稱:super-csv-declarative,代碼行數:6,代碼來源:Form.java


注:本文中的org.slf4j.helpers.FormattingTuple.getMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。