当前位置: 首页>>代码示例>>Java>>正文


Java LogLevel.WARN属性代码示例

本文整理汇总了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);
    }
}
 
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:27,代码来源:LogFilter.java

示例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);
}
 
开发者ID:cosysoft,项目名称:device,代码行数:21,代码来源:LogcatTest.java

示例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);
}
 
开发者ID:cosysoft,项目名称:device,代码行数:21,代码来源:Readme.java

示例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;
}
 
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:12,代码来源:LogPanel.java


注:本文中的com.android.ddmlib.Log.LogLevel.WARN属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。