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


Java Level.DEBUG屬性代碼示例

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


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

示例1: preInitNonCreationTests

public void preInitNonCreationTests() throws PlatformNotFoundException {
    //add a transformation
    Optional<Csar> csar = csarService.getCsar(VALID_CSAR_NAME);
    assertTrue(csar.isPresent());
    String[] pnames = {VALID_PLATFORM_NAME, SECOND_VALID_PLATFORM_NAME};

    for (String pname : pnames) {

        Log mockLog = mock(Log.class);
        LogEntry entry = new LogEntry(0, "Test Message", Level.DEBUG);
        when(mockLog.getLogEntries(0)).thenReturn(Collections.singletonList(entry));

        Transformation transformation = new TransformationImpl(
            csar.get(),
            platformService.findPlatformById(pname).get(),
            mockLog
        );
        transformation = spy(transformation);
        csar.get().getTransformations().put(pname, transformation);
    }
}
 
開發者ID:StuPro-TOSCAna,項目名稱:TOSCAna,代碼行數:21,代碼來源:TransformationControllerTest.java

示例2: 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

示例3: getLogbackLogLevel

private Level getLogbackLogLevel(org.slf4j.event.Level slf4jLevel) {
    if(slf4jLevel.equals(org.slf4j.event.Level.INFO)) return Level.INFO;
    if(slf4jLevel.equals(org.slf4j.event.Level.DEBUG)) return Level.DEBUG;
    if(slf4jLevel.equals(org.slf4j.event.Level.WARN)) return Level.WARN;
    if(slf4jLevel.equals(org.slf4j.event.Level.ERROR)) return Level.ERROR;

    throw new IllegalArgumentException("Unknown log level");
}
 
開發者ID:paypal,項目名稱:butterfly,代碼行數:8,代碼來源:LogbackLogConfigurator.java

示例4: setUp

@Before
public void setUp() throws Exception {
    log = new LogImpl(new File(tmpdir, "log"));
    logger.info("Creating dummy log entries");
    for (int index = 0; index < 100; index++) {
        LogEntry logEntry = new LogEntry(index, String.format("Log-Message-%d", index), Level.DEBUG);
        log.addLogEntry(logEntry);
    }
    logfile = new File(tmpdir, "log");
}
 
開發者ID:StuPro-TOSCAna,項目名稱:TOSCAna,代碼行數:10,代碼來源:LogImplTest.java

示例5: getLevel

@Override
public Level getLevel() {
    if (event.getLevel().levelInt <= Level.DEBUG_INT) {
        return event.getLevel();
    }
    return Level.DEBUG;
}
 
開發者ID:line,項目名稱:centraldogma,代碼行數:7,代碼來源:ExpectedExceptionAppender.java

示例6: 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

示例7: testBasic

@Test(timeout = 5000)
public void testBasic() throws InterruptedException {
	CloudWatchAppender appender = new CloudWatchAppender();
	AWSLogsClient awsLogClient = createMock(AWSLogsClient.class);
	appender.setAwsLogsClient(awsLogClient);

	appender.setMaxBatchSize(1);
	appender.setRegion("region");
	final String logGroup = "pfqoejpfqe";
	appender.setLogGroup(logGroup);
	final String logStream = "pffqjfqjpoqoejpfqe";
	appender.setLogStream(logStream);
	PatternLayout layout = new PatternLayout();
	layout.setContext(new LoggerContext());
	layout.setPattern("[%thread] %level %logger{20} - %msg%n%xThrowable");
	layout.start();
	appender.setLayout(layout);

	LoggingEvent event = new LoggingEvent();
	event.setTimeStamp(System.currentTimeMillis());
	String loggerName = "name";
	event.setLoggerName(loggerName);
	Level level = Level.DEBUG;
	event.setLevel(level);
	String message = "fjpewjfpewjfpewjfepowf";
	event.setMessage(message);

	String threadName = Thread.currentThread().getName();
	final String fullMessage = "[" + threadName + "] " + level + " " + loggerName + " - " + message + "\n";

	final PutLogEventsResult result = new PutLogEventsResult();
	String sequence = "ewopjfewfj";
	result.setNextSequenceToken(sequence);
	expect(awsLogClient.putLogEvents(isA(PutLogEventsRequest.class))).andAnswer(new IAnswer<PutLogEventsResult>() {
		@Override
		public PutLogEventsResult answer() {
			PutLogEventsRequest request = (PutLogEventsRequest) getCurrentArguments()[0];
			assertEquals(logGroup, request.getLogGroupName());
			assertEquals(logStream, request.getLogStreamName());
			List<InputLogEvent> events = request.getLogEvents();
			assertEquals(1, events.size());
			assertEquals(fullMessage, events.get(0).getMessage());
			return result;
		}
	}).times(2);
	awsLogClient.shutdown();

	// =====================================

	replay(awsLogClient);
	appender.start();
	// for coverage
	appender.start();
	appender.append(event);
	Thread.sleep(10);
	appender.append(event);
	while (appender.getEventsWrittenCount() < 2) {
		Thread.sleep(10);
	}
	appender.stop();
	verify(awsLogClient);
}
 
開發者ID:j256,項目名稱:cloudwatch-logback-appender,代碼行數:62,代碼來源:CloudWatchAppenderTest.java


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