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

Unified Diff: build/android/devil/android/sdk/adb_wrapper.py

Issue 1484253003: [Android] Add record functionality to logcat monitor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 5 years 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
Index: build/android/devil/android/sdk/adb_wrapper.py
diff --git a/build/android/devil/android/sdk/adb_wrapper.py b/build/android/devil/android/sdk/adb_wrapper.py
index 38db0e1fc1f1429f73d108663791ac7277aa1f3a..0448238eefcce885438bbcd0b3037ce9ad26e5c9 100644
--- a/build/android/devil/android/sdk/adb_wrapper.py
+++ b/build/android/devil/android/sdk/adb_wrapper.py
@@ -147,7 +147,7 @@ class AdbWrapper(object):
device_serial=self._device_serial,
check_error=check_error)
- def _IterRunDeviceAdbCmd(self, args, timeout):
+ def _IterRunDeviceAdbCmdLines(self, args, timeout):
"""Runs an adb command and returns an iterator over its output lines.
Args:
@@ -160,6 +160,19 @@ class AdbWrapper(object):
return cmd_helper.IterCmdOutputLines(
self._BuildAdbCmd(args, self._device_serial), timeout=timeout)
+ def _IterRunDeviceAdbCmd(self, args, timeout):
+ """Runs an adb command and returns an iterator over its output.
+
+ Args:
+ args: A list of arguments to adb.
+ timeout: Timeout in seconds.
+
+ Yields:
+ The current output of the command.
+ """
+ return cmd_helper.IterCmdOutput(
+ self._BuildAdbCmd(args, self._device_serial), timeout=timeout)
+
def __eq__(self, other):
"""Consider instances equal if they refer to the same device.
@@ -375,7 +388,7 @@ class AdbWrapper(object):
cmd, 'path does not specify an accessible directory in the device',
device_serial=self._device_serial)
- def Logcat(self, clear=False, dump=False, filter_specs=None,
+ def Logcat(self, clear=False, dump=False, output_file=None, filter_specs=None,
logcat_format=None, ring_buffer=None, timeout=None,
retries=_DEFAULT_RETRIES):
"""Get an iterable over the logcat output.
@@ -411,6 +424,8 @@ class AdbWrapper(object):
if ring_buffer:
for buffer_name in ring_buffer:
cmd.extend(['-b', buffer_name])
+ if output_file:
+ cmd.extend(['-f', output_file])
if filter_specs:
cmd.extend(filter_specs)

Powered by Google App Engine
This is Rietveld 408576698