def _read(self, ti, try_number, metadata=None):
<EOL>log_relative_path = self._render_filename(ti, try_number)<EOL>remote_loc = os.path.join(self.remote_base, log_relative_path)<EOL>try:<EOL><INDENT>remote_log = self.gcs_read(remote_loc)<EOL>log = '<STR_LIT>'.format(<EOL>remote_loc, remote_log)<EOL>return log, {'<STR_LIT>': True}<EOL><DEDENT>except Exception as e:<EOL><INDENT>log = '<STR_LIT>'.format(<EOL>remote_loc, str(e))<EOL>self.log.error(log)<EOL>local_log, metadata = super()._read(ti, try_number)<EOL>log += local_log<EOL>return log, metadata<EOL><DEDENT>
Read logs of given task instance and try_number from GCS.
If failed, read the log from task instance host machine.
:param ti: task instance object
:param try_number: task instance try_number to read logs from
:param metadata: log metadata,
                 can be used for steaming log reading and auto-tailing.