def METHOD_NAME(self) -> None:
    if len(self._logs) == 0:
        return
    msgs = []
    while len(self._logs):
        data = self._logs.popleft()
        self._buf += data
        while "\n" in self._buf:
            idx = self._buf.index("\n") + 1
            line = self._buf[:idx]
            self._buf = self._buf[idx:]
            msg = dict(self._logs_metadata)
            msg["log"] = line
            msgs.append(msg)
        if len(msgs) > LOG_BATCH_MAX_SIZE:
            self._ship(msgs)
            msgs = []
    if len(msgs) > 0:
        self._ship(msgs)