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