当前位置: 首页>>代码示例>>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;未经允许,请勿转载。