Ejemplo n.º 1
0
  def Stop(self):
    """Stops the logcat monitor.

    Close the logdog stream as well.
    """
    try:
      super(LogdogLogcatMonitor, self)._StopRecording()
      if self._logdog_stream:
        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)
Ejemplo n.º 2
0
  def Stop(self):
    """Stops the logcat monitor.

    Close the logdog stream as well.
    """
    try:
      super(LogdogLogcatMonitor, self)._StopRecording()
      if self._logdog_stream:
        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)
Ejemplo n.º 3
0
 def upload_logcats_file():
   try:
     yield
   finally:
     if not args.logcat_output_file:
       logging.critical('Cannot upload logcats file. '
                       'File to save logcat is not specified.')
     else:
       with open(args.logcat_output_file) as src:
         dst = logdog_helper.open_text('unified_logcats')
         if dst:
           shutil.copyfileobj(src, dst)
           dst.close()
           logging.critical(
               'Logcat: %s', logdog_helper.get_viewer_url('unified_logcats'))
Ejemplo n.º 4
0
 def upload_logcats_file():
     try:
         yield
     finally:
         if not args.logcat_output_file:
             logging.critical('Cannot upload logcats file. '
                              'File to save logcat is not specified.')
         else:
             with open(args.logcat_output_file) as src:
                 dst = logdog_helper.open_text('unified_logcats')
                 if dst:
                     shutil.copyfileobj(src, dst)
                     dst.close()
                     logging.critical(
                         'Logcat: %s',
                         logdog_helper.get_viewer_url('unified_logcats'))
Ejemplo n.º 5
0
 def upload_logcats_file():
   try:
     yield
   finally:
     if not args.logcat_output_file:
       logging.critical('Cannot upload logcat file: no file specified.')
     elif not os.path.exists(args.logcat_output_file):
       logging.critical("Cannot upload logcat file: file doesn't exist.")
     else:
       with open(args.logcat_output_file) as src:
         dst = logdog_helper.open_text('unified_logcats')
         if dst:
           shutil.copyfileobj(src, dst)
           dst.close()
           logging.critical(
               'Logcat: %s', logdog_helper.get_viewer_url('unified_logcats'))
Ejemplo n.º 6
0
 def upload_logcats_file():
   try:
     yield
   finally:
     if not args.logcat_output_file:
       logging.critical('Cannot upload logcat file: no file specified.')
     elif not os.path.exists(args.logcat_output_file):
       logging.critical("Cannot upload logcat file: file doesn't exist.")
     else:
       with open(args.logcat_output_file) as src:
         dst = logdog_helper.open_text('unified_logcats')
         if dst:
           shutil.copyfileobj(src, dst)
           dst.close()
           logging.critical(
               'Logcat: %s', logdog_helper.get_viewer_url('unified_logcats'))
Ejemplo n.º 7
0
 def _Link(self):
     return logdog_helper.get_viewer_url(self._stream_name)
Ejemplo n.º 8
0
 def _Link(self):
   return logdog_helper.get_viewer_url(self._stream_name)