Index: build/android/pylib/local/device/local_device_environment.py |
diff --git a/build/android/pylib/local/device/local_device_environment.py b/build/android/pylib/local/device/local_device_environment.py |
index 178e2f18a3e0337fd35eebfda4f8af02ed009c28..5a0f30414049428cb426d4cc9f142f7037c341ed 100644 |
--- a/build/android/pylib/local/device/local_device_environment.py |
+++ b/build/android/pylib/local/device/local_device_environment.py |
@@ -14,6 +14,7 @@ from devil.android import device_errors |
from devil.android import device_list |
from devil.android import device_utils |
from devil.android import logcat_monitor |
+from devil.utils import cmd_helper |
from devil.utils import file_utils |
from devil.utils import parallelizer |
from pylib import constants |
@@ -44,6 +45,8 @@ class LocalDeviceEnvironment(environment.Environment): |
self._skip_clear_data = args.skip_clear_data |
self._target_devices_file = args.target_devices_file |
self._tool_name = args.tool |
+ self._logdog_command = args.logdog_command.split() |
+ self._logdog_stream = args.logdog_stream.split() |
#override |
def SetUp(self): |
@@ -125,14 +128,32 @@ class LocalDeviceEnvironment(environment.Environment): |
with open(cache_path, 'w') as f: |
f.write(d.DumpCacheData()) |
logging.info('Wrote device cache: %s', cache_path) |
+ logging.info('Adding device serials to logcats') |
for m in self._logcat_monitors: |
m.Stop() |
m.Close() |
+ add_device_args = ['sed', '-i', '-e', |
+ 's/^/device({0}) /'. |
+ format(m._adb.GetDeviceSerial()), |
+ m.output_file] |
+ cmd_helper.RunCmd(add_device_args) |
if self._logcat_output_file: |
file_utils.MergeFiles( |
self._logcat_output_file, |
[m.output_file for m in self._logcat_monitors]) |
shutil.rmtree(self._logcat_output_dir) |
+ if self._logdog_command and self._logdog_stream: |
+ logging.info('NOTE: outputs below are specific to logdog.') |
+# task = str(os.environ['SWARMING_TASK_ID']) |
+# prefix = ['-prefix', 'android/swarming/logcats/task{0}'.format(task)] |
+# cmd = self._logdog_command + prefix + self._logdog_stream |
+ cmd = self._logdog_command.split() |
+ cmd_helper.RunCmd(cmd) |
+ url_prefix = self._logdog_command[-4].replace('/', '%2F') |
+ suffix = self._logdog_command[-1] |
+ url_suffix = 'file:{0}'.format(suffix.replace('/', '_')) |
+ url = 'https://luci-logdog-dev.appspot.com/v/?s=chromium%2F{0}%2F%2B%2F{1}'.format(url_prefix, url_suffix) |
ghost stip (do not use)
2016/07/20 22:24:23
80 chars, and are we switching back to prod for th
nicholaslin
2016/07/23 01:23:21
I would assume so. Will talk to Dan later.
|
+ logging.info('Logcats are at %s', url) |
def BlacklistDevice(self, device, reason='local_device_failure'): |
device_serial = device.adb.GetDeviceSerial() |