'Writes a line to the logs buffer.'

def _write(self, line):

    if (self._request != logsutil.RequestID()):
        self._reset()
    if line:
        if (self._buffer and (not self._buffer[(-1)].IsComplete())):
            record = self._buffer.pop()
            self._bytes -= len(record)
            record.message += line
            self._buffer.append(logsutil.StderrRecord(''))
        else:
            record = logsutil.RecordFromLine(line)
        self._buffer.append(record)
        self._bytes += len(record)
    self._autoflush()
