本文整理汇总了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);
}
}
示例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());
}
示例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");
}
示例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");
}
示例5: getLevel
@Override
public Level getLevel() {
if (event.getLevel().levelInt <= Level.DEBUG_INT) {
return event.getLevel();
}
return Level.DEBUG;
}
示例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);
}
示例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);
}