Index: build/android/pylib/remote/device/remote_device_test_run.py |
diff --git a/build/android/pylib/remote/device/remote_device_test_run.py b/build/android/pylib/remote/device/remote_device_test_run.py |
index 5bfbc4f7740beba8f8616ebfab0291593d9276d7..03c16ed7af5359ff5eb6117b8ce7ba843617c52c 100644 |
--- a/build/android/pylib/remote/device/remote_device_test_run.py |
+++ b/build/android/pylib/remote/device/remote_device_test_run.py |
@@ -7,6 +7,7 @@ |
import json |
import logging |
import os |
+import re |
import shutil |
import string |
import tempfile |
@@ -336,7 +337,22 @@ class RemoteDeviceTestRun(test_run.TestRun): |
try: |
logcat = z.read('appurify_results/logcat.txt') |
printable_logcat = ''.join(c for c in logcat if c in string.printable) |
+ logging.log(level, '---Logging remote device logcat---') |
jbudorick
2015/08/06 16:31:36
+1
rnephew (Reviews Here)
2015/08/06 16:42:07
Done.
|
for line in printable_logcat.splitlines(): |
logging.log(level, line) |
+ logging.log(level, '---Ending remote device logcat---') |
except KeyError: |
logging.error('No logcat found.') |
+ |
+ def _DidDeviceGoOffline(self): |
+ device_offline = re.compile('error: device not found') |
jbudorick
2015/08/06 16:31:36
This should be compiled into a constant at module
rnephew (Reviews Here)
2015/08/06 16:42:07
Done.
|
+ zip_file = self._DownloadTestResults(None) |
+ with zipfile.ZipFile(zip_file) as z: |
+ adb_trace_log = z.read('adb_trace.log') |
+ if any(device_offline.search(l) for l in adb_trace_log.splitlines()): |
+ logging.critical('---Logging remote device adb trace log---') |
jbudorick
2015/08/06 16:31:36
The function name doesn't imply anything about log
rnephew (Reviews Here)
2015/08/06 16:42:07
Done.
|
+ for line in adb_trace_log.splitlines(): |
+ logging.critical(line) |
+ logging.critical('---Ending remote device adb trace log---') |
+ return True |
+ return False |