Ejemplo n.º 1
0
 def _print_available(tail, stream, should_persist=False):
     # print the latest batch of lines from S3Tail
     try:
         for line in tail:
             if should_persist:
                 line = set_should_persist(line)
             else:
                 line = refine(line, prefix=prefix)
             echo(line.strip().decode('utf-8', errors='replace'), stream)
     except Exception as ex:
         echo('[ temporary error in fetching logs: %s ]' % ex,
              'stderr',
              batch_id=self.job.id)
Ejemplo n.º 2
0
 def _print_available(tail, stream, should_persist=False):
     # print the latest batch of lines from S3Tail
     prefix = b"[%s] " % util.to_bytes(self._job.id)
     try:
         for line in tail:
             if should_persist:
                 line = set_should_persist(line)
             else:
                 line = refine(line, prefix=prefix)
             echo(line.strip().decode("utf-8", errors="replace"), stream)
     except Exception as ex:
         echo(
             "[ temporary error in fetching logs: %s ]" % ex,
             "stderr",
             job_id=self._job.id,
         )