本文整理汇总了Java中com.android.ddmlib.Log.LogLevel.WARN属性的典型用法代码示例。如果您正苦于以下问题:Java LogLevel.WARN属性的具体用法?Java LogLevel.WARN怎么用?Java LogLevel.WARN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.android.ddmlib.Log.LogLevel
的用法示例。
在下文中一共展示了LogLevel.WARN属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addTableItem
/**
* Add a TableItem for the index-th item of the buffer
* @param filter The index of the table in which to insert the item.
*/
private void addTableItem(LogMessage msg) {
TableItem item = new TableItem(mTable, SWT.NONE);
item.setText(0, msg.data.time);
item.setText(1, new String(new char[] { msg.data.logLevel.getPriorityLetter() }));
item.setText(2, msg.data.pidString);
item.setText(3, msg.data.tag);
item.setText(4, msg.msg);
// add the buffer index as data
item.setData(msg);
if (msg.data.logLevel == LogLevel.INFO) {
item.setForeground(mColors.infoColor);
} else if (msg.data.logLevel == LogLevel.DEBUG) {
item.setForeground(mColors.debugColor);
} else if (msg.data.logLevel == LogLevel.ERROR) {
item.setForeground(mColors.errorColor);
} else if (msg.data.logLevel == LogLevel.WARN) {
item.setForeground(mColors.warningColor);
} else {
item.setForeground(mColors.verboseColor);
}
}
示例2: testLog
@Test
public void testLog() throws InterruptedException {
AndroidDevice device = pollFirst();
final LogCatFilter filter = new LogCatFilter("", "", "com.android", "",
"", LogLevel.WARN);
final LogCatListener lcl = new LogCatListener() {
@Override
public void log(List<LogCatMessage> msgList) {
for (LogCatMessage msg : msgList) {
if (filter.matches(msg)) {
System.out.println(msg);
}
}
}
};
device.addLogCatListener(lcl);
Thread.sleep(50000000);
}
示例3: testLogcat
@Test
public void testLogcat() throws InterruptedException {
AndroidDevice device = getDevices().pollFirst();
final LogCatFilter filter = new LogCatFilter("", "", "com.android", "",
"", LogLevel.WARN);
final LogCatListener lcl = new LogCatListener() {
@Override
public void log(List<LogCatMessage> msgList) {
for (LogCatMessage msg : msgList) {
if (filter.matches(msg)) {
System.out.println(msg);
}
}
}
};
device.addLogCatListener(lcl);
Thread.sleep(60000);
}
示例4: getSelectedErrorLineMessage
public String getSelectedErrorLineMessage() {
Table table = mCurrentFilter.getTable();
int[] selection = table.getSelectionIndices();
if (selection.length == 1) {
TableItem item = table.getItem(selection[0]);
LogMessage msg = (LogMessage)item.getData();
if (msg.data.logLevel == LogLevel.ERROR || msg.data.logLevel == LogLevel.WARN)
return msg.msg;
}
return null;
}