当前位置: 首页>>代码示例>>Java>>正文


Java Level.TRACE属性代码示例

本文整理汇总了Java中ch.qos.logback.classic.Level.TRACE属性的典型用法代码示例。如果您正苦于以下问题:Java Level.TRACE属性的具体用法?Java Level.TRACE怎么用?Java Level.TRACE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在ch.qos.logback.classic.Level的用法示例。


在下文中一共展示了Level.TRACE属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

static int execute(JetGatlingOptions options) {
    String workingDir = System.getProperty("user.dir");

    GatlingPropertiesBuilder builder = new GatlingPropertiesBuilder();
    builder.simulationClass(SIMULATION);
    builder.dataDirectory(workingDir);
    builder.bodiesDirectory(workingDir);
    builder.mute();

    if (options.getTimeout() > -1) {
        System.setProperty("gatling.http.ahc.readTimeout", String.valueOf(options.getTimeout()));
    }

    if (options.isDebug() || options.isTrace()) {
        Level logLevel = options.isTrace() ? Level.TRACE : Level.DEBUG;

        LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
        loggerContext.getLogger("io.gatling.http.ahc").setLevel(logLevel);
        loggerContext.getLogger("io.gatling.http.response").setLevel(logLevel);
        loggerContext.getLogger("io.gatling.app").setLevel(logLevel);
        loggerContext.getLogger("com.github.scw1109.jetgatling").setLevel(logLevel);
    }

    return Gatling.fromMap(builder.build());
}
 
开发者ID:scw1109,项目名称:jet-gatling,代码行数:25,代码来源:GatlingExecutor.java

示例2: setLogLevel

/**
 * This method sets the log level (logback).
 */
public void setLogLevel() {
    logLevel = System.getProperty("logLevel", LOG_LEVEL_INFO);
    Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
    Level logLevelSetting;
    switch (logLevel.toLowerCase()) {
    case LOG_LEVEL_ERROR:
        logLevelSetting = Level.ERROR;
        break;
    case LOG_LEVEL_WARN:
        logLevelSetting = Level.WARN;
        break;
    case LOG_LEVEL_ALL:
        logLevelSetting = Level.ALL;
        break;
    case LOG_LEVEL_TRACE_LOG:
        logLevelSetting = Level.TRACE;
        break;
    case LOG_LEVEL_INFO:
        logLevelSetting = Level.INFO;
        break;
    case LOG_LEVEL_DEBUG:
        logLevelSetting = Level.DEBUG;
        break;
    default:
        logLevelSetting = Level.INFO;
        break;
    }
    root.setLevel(logLevelSetting);
}
 
开发者ID:HotelsDotCom,项目名称:heat,代码行数:32,代码来源:LoggingUtils.java


注:本文中的ch.qos.logback.classic.Level.TRACE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。