Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2542)

Unified Diff: build/android/pylib/device/logcat_monitor.py

Issue 930373006: [Android] Restore filter specs to AdbWrapper.Logcat and LogcatMonitor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/pylib/device/adb_wrapper.py ('k') | build/android/pylib/linker/test_case.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/device/logcat_monitor.py
diff --git a/build/android/pylib/device/logcat_monitor.py b/build/android/pylib/device/logcat_monitor.py
index 7ede49c53b811f41f381389e26c0798e066d0111..1d4cc24fa955467c8be13d82e95e5dff72ff4251 100644
--- a/build/android/pylib/device/logcat_monitor.py
+++ b/build/android/pylib/device/logcat_monitor.py
@@ -22,18 +22,20 @@ class LogcatMonitor(object):
# Format: <DATE> <TIME> <PID> <TID> <LEVEL> <COMPONENT>: <MESSAGE>
_THREADTIME_RE_FORMAT = r'\S* +\S* +(%s) +(%s) +(%s) +(%s): +(%s)$'
- def __init__(self, adb, clear=True):
+ def __init__(self, adb, clear=True, filter_specs=None):
"""Create a LogcatMonitor instance.
Args:
adb: An instance of adb_wrapper.AdbWrapper.
clear: If True, clear the logcat when monitoring starts.
+ filter_specs: An optional list of '<tag>[:priority]' strings.
"""
if isinstance(adb, adb_wrapper.AdbWrapper):
self._adb = adb
else:
raise ValueError('Unsupported type passed for argument "device"')
self._clear = clear
+ self._filter_specs = filter_specs
self._logcat_out = None
self._logcat_out_file = None
self._logcat_proc = None
@@ -76,7 +78,7 @@ class LogcatMonitor(object):
# returned.
# - failure_regex matches a line, in which case None is returned
# - the timeout is hit, in which case a CommandTimeoutError is raised.
- for l in self._adb.Logcat():
+ for l in self._adb.Logcat(filter_specs=self._filter_specs):
m = success_regex.search(l)
if m:
return m
« no previous file with comments | « build/android/pylib/device/adb_wrapper.py ('k') | build/android/pylib/linker/test_case.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698