Chromium Code Reviews| Index: build/android/pylib/android/logdog_logcat_monitor.py |
| diff --git a/build/android/pylib/android/logdog_logcat_monitor.py b/build/android/pylib/android/logdog_logcat_monitor.py |
| index 2125e2e7780bcd64ffae019fd82f4e86c03c1629..250bf72d88b801bcf503ec477beb75feb661d8b2 100644 |
| --- a/build/android/pylib/android/logdog_logcat_monitor.py |
| +++ b/build/android/pylib/android/logdog_logcat_monitor.py |
| @@ -2,21 +2,16 @@ |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| -import os |
| import logging |
| -import sys |
| from devil.android import logcat_monitor |
| from devil.utils import reraiser_thread |
| -from pylib import constants |
| - |
| -sys.path.insert(0, os.path.abspath(os.path.join( |
| - constants.DIR_SOURCE_ROOT, 'tools', 'swarming_client'))) |
| -from libs.logdog import bootstrap # pylint: disable=import-error |
| +from pylib.utils import logdog_helper |
| class LogdogLogcatMonitor(logcat_monitor.LogcatMonitor): |
| """Logcat monitor that writes logcat to a logdog stream. |
| - The logdog stream client will return a url, where contains the logcat. |
| + |
| + The logdog stream client will return a url which contains the logcat. |
| """ |
| def __init__(self, adb, stream_name, clear=True, filter_specs=None): |
| super(LogdogLogcatMonitor, self).__init__(adb, clear, filter_specs) |
| @@ -24,16 +19,7 @@ class LogdogLogcatMonitor(logcat_monitor.LogcatMonitor): |
| self._logdog_stream = None |
| self._stream_client = None |
| self._stream_name = stream_name |
| - try: |
| - self._stream_client = bootstrap.ButlerBootstrap.probe().stream_client() |
| - self._logdog_stream = self._stream_client.open_text(self._stream_name) |
| - except bootstrap.NotBootstrappedError as e: |
| - if logging.getLogger().isEnabledFor(logging.DEBUG): |
| - logging.exception('Unable to enable logdog_logcat: %s.', e) |
| - except (KeyError, ValueError) as e: |
| - logging.exception('Error when creating stream_client/stream: %s.', e) |
| - except Exception as e: # pylint: disable=broad-except |
| - logging.exception('Unknown Error: %s.', e) |
| + self._logdog_stream = logdog_helper.open_text(self._stream_name) |
|
jbudorick
2017/01/31 16:11:53
While I recognize that you're not changing the beh
mikecase (-- gone --)
2017/01/31 23:08:25
Moved opening stream to Start()
|
| def GetLogcatURL(self): |
| """Return logcat url. |
| @@ -50,11 +36,7 @@ class LogdogLogcatMonitor(logcat_monitor.LogcatMonitor): |
| try: |
| super(LogdogLogcatMonitor, self)._StopRecording() |
| if self._logdog_stream: |
| - try: |
| - self._logcat_url = self._stream_client.get_viewer_url( |
| - self._stream_name) |
| - except (KeyError, ValueError) as e: |
| - logging.exception('Error cannot get viewer url: %s', e) |
| + self._logcat_url = logdog_helper.get_viewer_url(self._stream_name) |
| self._logdog_stream.close() |
| except Exception as e: # pylint: disable=broad-except |
| logging.exception('Unknown Error: %s.', e) |