當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。