本文整理汇总了Java中com.android.ddmlib.Log.LogLevel.ASSERT属性的典型用法代码示例。如果您正苦于以下问题:Java LogLevel.ASSERT属性的具体用法?Java LogLevel.ASSERT怎么用?Java LogLevel.ASSERT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.android.ddmlib.Log.LogLevel
的用法示例。
在下文中一共展示了LogLevel.ASSERT属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processLogLines
/**
* Parse a list of strings into {@link LogCatMessage} objects. This method
* maintains state from previous calls regarding the last seen header of
* logcat messages.
* @param lines list of raw strings obtained from logcat -v long
* @param device device from which these log messages have been received
* @return list of LogMessage objects parsed from the input
*/
@NonNull
public List<LogCatMessage> processLogLines(String[] lines, IDevice device) {
List<LogCatMessage> messages = new ArrayList<LogCatMessage>(lines.length);
for (String line : lines) {
if (line.isEmpty()) {
continue;
}
Matcher matcher = sLogHeaderPattern.matcher(line);
if (matcher.matches()) {
mCurTime = matcher.group(1);
mCurPid = matcher.group(2);
mCurTid = matcher.group(3);
mCurLogLevel = LogLevel.getByLetterString(matcher.group(4));
mCurTag = matcher.group(5).trim();
/* LogLevel doesn't support messages with severity "F". Log.wtf() is supposed
* to generate "A", but generates "F". */
if (mCurLogLevel == null && matcher.group(4).equals("F")) {
mCurLogLevel = LogLevel.ASSERT;
}
} else {
String pkgName = ""; //$NON-NLS-1$
Integer pid = Ints.tryParse(mCurPid);
if (pid != null && device != null) {
pkgName = device.getClientName(pid);
}
LogCatMessage m = new LogCatMessage(mCurLogLevel, mCurPid, mCurTid,
pkgName, mCurTag, mCurTime, line);
messages.add(m);
}
}
return messages;
}
示例2: processLogLines
/**
* Parse a list of strings into {@link LogCatMessage} objects. This method
* maintains state from previous calls regarding the last seen header of
* logcat messages.
* @param lines list of raw strings obtained from logcat -v long
* @param pidToNameMapper mapper to obtain the app name given a pid
* @return list of LogMessage objects parsed from the input
*/
public List<LogCatMessage> processLogLines(String[] lines,
LogCatPidToNameMapper pidToNameMapper) {
List<LogCatMessage> messages = new ArrayList<LogCatMessage>(lines.length);
for (String line : lines) {
if (line.length() == 0) {
continue;
}
Matcher matcher = sLogHeaderPattern.matcher(line);
if (matcher.matches()) {
mCurTime = matcher.group(1);
mCurPid = matcher.group(2);
mCurTid = matcher.group(3);
mCurLogLevel = LogLevel.getByLetterString(matcher.group(4));
mCurTag = matcher.group(5).trim();
/* LogLevel doesn't support messages with severity "F". Log.wtf() is supposed
* to generate "A", but generates "F". */
if (mCurLogLevel == null && matcher.group(4).equals("F")) {
mCurLogLevel = LogLevel.ASSERT;
}
} else {
LogCatMessage m = new LogCatMessage(mCurLogLevel, mCurPid, mCurTid,
pidToNameMapper.getName(mCurPid),
mCurTag, mCurTime, line);
messages.add(m);
}
}
return messages;
}