本文整理汇总了Java中org.apache.log4j.Priority.DEBUG属性的典型用法代码示例。如果您正苦于以下问题:Java Priority.DEBUG属性的具体用法?Java Priority.DEBUG怎么用?Java Priority.DEBUG使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.log4j.Priority
的用法示例。
在下文中一共展示了Priority.DEBUG属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
public
void run() {
while(true) {
synchronized(this) {
try {
this.wait();
} catch(Exception e) {
}
}
for(int i = 0; i < burst; i++) {
LoggingEvent event = new LoggingEvent("x", cat, Priority.DEBUG,
"Message "+counter, null);
event.getThreadName();
if(counter % 50 == 0) {
//event.throwable = new Exception("hello "+counter);
}
counter++;
view.add(event);
}
}
}
示例2: append_debug
@Test
public void append_debug() {
MockLoggingChannel log = new MockLoggingChannel();
KettleLogChannelAppender appender = new KettleLogChannelAppender(log);
Logger testLogger = Logger.getLogger(getClass());
testLogger.setLevel(Level.ALL);
// DEBUG messages should be interpreted as "debug" messages
Layout layout = new Log4jKettleLayout();
@SuppressWarnings("deprecation")
LoggingEvent event = new LoggingEvent("org.test", testLogger, Priority.DEBUG, "debug test!", null);
appender.doAppend(event);
assertEquals(0, log.getBasicMessages().size());
assertEquals(0, log.getDetailedMessages().size());
assertEquals(0, log.getErrorMessages().size());
assertEquals(0, log.getMinimalMessages().size());
assertEquals(0, log.getRowLevelMessages().size());
assertEquals(1, log.getDebugMessages().size());
assertEquals(layout.format(event), log.getDebugMessages().get(0).getMessage());
}
示例3: getLogPriority
public Priority getLogPriority() {
if ( this.traceLevel == TRACE_INFO ) {
return Priority.INFO;
} else if ( this.traceLevel == TRACE_ERROR ) {
return Priority.ERROR;
} else if ( this.traceLevel == TRACE_DEBUG) {
return Priority.DEBUG;
} else if ( this.traceLevel == TRACE_TRACE) {
return Priority.DEBUG;
} else {
return Priority.FATAL;
}
}
示例4: actionPerformed
public
void actionPerformed(ActionEvent e) {
System.out.println("Action occured");
LoggingEvent event = new LoggingEvent("x", cat, Priority.DEBUG,
"Message "+j, null);
if(j % 5 == 0) {
//event.throwable = new Exception("hello "+j);
}
j++;
appender.add(event);
}
示例5: convertLog4JPriority
public static LogPriority convertLog4JPriority(Priority priority) {
LogPriority pri = LogPriority.INFO; // a reasonable default
if (priority == Priority.DEBUG) {
pri = LogPriority.DEBUG;
} else if (priority == Priority.ERROR) {
pri = LogPriority.ERROR;
} else if (priority == Priority.FATAL) {
pri = LogPriority.FATAL;
} else if (priority == Priority.INFO) {
pri = LogPriority.INFO;
} else if (priority == Priority.WARN) {
pri = LogPriority.WARN;
}
return pri;
}
示例6: createLoggingEvent
@SuppressWarnings("deprecation")
private LoggingEvent createLoggingEvent(long timestamp, String message, Throwable ex)
{
return new LoggingEvent(getClass().getName(), logger, timestamp, Priority.DEBUG, message, ex);
}