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


Java MessageFormatter.format方法代碼示例

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


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

示例1: debug

import org.slf4j.helpers.MessageFormatter; //導入方法依賴的package包/類
@Override
final public void debug(String format, Object arg1, Object arg2) {
    if (isDebugEnabled()) {
        FormattingTuple ft = MessageFormatter.format(format, arg1, arg2);
        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

示例2: warn

import org.slf4j.helpers.MessageFormatter; //導入方法依賴的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

示例3: error

import org.slf4j.helpers.MessageFormatter; //導入方法依賴的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

示例4: error

import org.slf4j.helpers.MessageFormatter; //導入方法依賴的package包/類
@Override
public void error(final String format, final Object arg) {
    final FormattingTuple ft = MessageFormatter.format(format, arg);
    Crashlytics.log(Log.ERROR, mTag, ft.getMessage());
    if (ft.getThrowable() != null) {
        exception(Log.ERROR, ft.getThrowable());
    }
}
 
開發者ID:dasfoo,項目名稱:delern,代碼行數:9,代碼來源:Logger.java

示例5: error

import org.slf4j.helpers.MessageFormatter; //導入方法依賴的package包/類
/**
 * Log a message at the ERROR level according to the specified format and argument.
 * This form avoids superfluous object creation when the logger is disabled for the ERROR level.
 *
 * @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(getCallerClassName(), Level.ERROR, ft.getMessage(),
                ft.getThrowable());
    }
}
 
開發者ID:wings27,項目名稱:easy-logger,代碼行數:15,代碼來源:EasyLog4jLogger.java

示例6: warn

import org.slf4j.helpers.MessageFormatter; //導入方法依賴的package包/類
/**
 * Log a message at the WARN level according to the specified format and argument.
 * This form avoids superfluous object creation when the logger is disabled for the WARN level.
 *
 * @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(getCallerClassName(), Level.WARN, ft.getMessage(),
                ft.getThrowable());
    }
}
 
開發者ID:wings27,項目名稱:easy-logger,代碼行數:15,代碼來源:EasyLog4jLogger.java

示例7: info

import org.slf4j.helpers.MessageFormatter; //導入方法依賴的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

示例8: trace

import org.slf4j.helpers.MessageFormatter; //導入方法依賴的package包/類
@Override
public void trace(final String format, final Object arg) {
    final FormattingTuple ft = MessageFormatter.format(format, arg);
    Crashlytics.log(Log.VERBOSE, mTag, ft.getMessage());
    if (ft.getThrowable() != null) {
        exception(Log.VERBOSE, ft.getThrowable());
    }
}
 
開發者ID:dasfoo,項目名稱:delern,代碼行數:9,代碼來源:Logger.java

示例9: doLog

import org.slf4j.helpers.MessageFormatter; //導入方法依賴的package包/類
private void doLog(Level lvl, String format, Object arg) {
    if (this.logger.isLoggable(lvl)) {
        FormattingTuple tuple = MessageFormatter.format(format, arg);
        doLog(lvl, tuple);
    }
}
 
開發者ID:vmware,項目名稱:xenon-utils,代碼行數:7,代碼來源:XenonClassLogger.java

示例10: formatAndLog

import org.slf4j.helpers.MessageFormatter; //導入方法依賴的package包/類
/**
 * For formatted messages, first substitute arguments and then log.
 *
 * @param level
 * @param format
 * @param arg1
 * @param arg2
 */
private void formatAndLog(int level, String format, Object arg1, Object arg2) {
    if (!isLevelEnabled(level)) {
        return;
    }
    FormattingTuple tp = MessageFormatter.format(format, arg1, arg2);
    log(level, tp.getMessage(), tp.getThrowable());
}
 
開發者ID:Esri,項目名稱:server-extension-java,代碼行數:16,代碼來源:LogAdaptor.java

示例11: info

import org.slf4j.helpers.MessageFormatter; //導入方法依賴的package包/類
/**
 * Log a message at the INFO level according to the specified format and arguments.
 * This form avoids superfluous object creation when the logger is disabled for the INFO level.
 *
 * @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(getCallerClassName(), Level.INFO, ft.getMessage(),
                ft.getThrowable());
    }
}
 
開發者ID:wings27,項目名稱:easy-logger,代碼行數:16,代碼來源:EasyLog4jLogger.java

示例12: error

import org.slf4j.helpers.MessageFormatter; //導入方法依賴的package包/類
/**
 * 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
 */
@Override
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());
    }
}
 
開發者ID:AmadeusITGroup,項目名稱:HttpSessionReplacer,代碼行數:24,代碼來源:Log4jLoggerAdapter.java

示例13: debug

import org.slf4j.helpers.MessageFormatter; //導入方法依賴的package包/類
/**
 * Log a message at level FINE according to the specified format and
 * arguments.
 *
 * <p>
 * This form avoids superfluous object creation when the logger is disabled
 * for the FINE level.
 * </p>
 *
 * @param format
 *          the format string
 * @param arg1
 *          the first argument
 * @param arg2
 *          the second argument
 */
@Override
public void debug(String format, Object arg1, Object arg2) {
    if (logger.isLoggable(Level.FINE)) {
        FormattingTuple ft = MessageFormatter.format(format, arg1, arg2);
        log(SELF, Level.FINE, ft.getMessage(), ft.getThrowable());
    }
}
 
開發者ID:AmadeusITGroup,項目名稱:HttpSessionReplacer,代碼行數:24,代碼來源:JDK14LoggerAdapter.java

示例14: info

import org.slf4j.helpers.MessageFormatter; //導入方法依賴的package包/類
/**
 * Delegates to the {@link Log#info(java.lang.Object)} method of the underlying
 * {@link Log} instance.
 *
 * <p>
 * However, this form avoids superfluous object creation when the logger is disabled
 * for level INFO.
 * </p>
 *
 * @param format
 *          the format string
 * @param arg
 *          the argument
 */

@Override
public void info(String format, Object arg) {
    if (log.isInfoEnabled()) {
        FormattingTuple ft = MessageFormatter.format(format, arg);
        log.info(ft.getMessage(), ft.getThrowable());
    }
}
 
開發者ID:AmadeusITGroup,項目名稱:HttpSessionReplacer,代碼行數:23,代碼來源:JCLLoggerAdapter.java

示例15: error

import org.slf4j.helpers.MessageFormatter; //導入方法依賴的package包/類
/**
 * Delegates to the {@link Log#error(java.lang.Object)} method of the underlying
 * {@link Log} instance.
 *
 * <p>
 * However, this form avoids superfluous object creation when the logger is disabled
 * for level ERROR.
 * </p>
 *
 * @param format
 *          the format string
 * @param arg
 *          the argument
 */
@Override
public void error(String format, Object arg) {
    if (log.isErrorEnabled()) {
        FormattingTuple ft = MessageFormatter.format(format, arg);
        log.error(ft.getMessage(), ft.getThrowable());
    }
}
 
開發者ID:AmadeusITGroup,項目名稱:HttpSessionReplacer,代碼行數:22,代碼來源:JCLLoggerAdapter.java


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