def readline(self):
        old_position = self.log_history_['position']
        position = self.log_history_['position']
        partial_line = self.log_history_['partial_line']
        try:
            with open(self.pathname_) as logfile:
                logfile.seek(position)
                while True:
                    line = logfile.readline()
                    partial_line += line
                    position = logfile.tell()
                    if position > self.log_history_['position']:
                        self.log_history_['position'] = position

                    if partial_line.endswith('\n'):
                        self.log_history_['partial_line'] = ''
                        yield partial_line
                        partial_line = self.log_history_['partial_line']
                    else:
                        self.log_history_['partial_line'] = partial_line
                        break
                if partial_line:
                    yield partial_line

        except Exception as error:
            logging.error('failed to processing file %s', self.pathname_)
            raise error

        logging.debug(
            'processing file %s log %s bytes to position %s',
            self.pathname_, position - old_position, position
        )
Delete a deployed REST API Gateway.
dataset/ETHPy150Open openstack/compass-core/compass/log_analyzor/file_matcher.py/FileReader.readline--crossover with--dataset/ETHPy150Open Miserlou/Zappa/zappa/zappa.py/Zappa.undeploy_api_gateway