def _stream_logs(self) -> None:
        """Stream logs from the Docker container to stdout."""
        if not self.log_generator:
            self.log('error', 'Log generator not initialized')
            return

        try:
            for log_line in self.log_generator:
                if self._stop_event.is_set():
                    break
                if log_line:
                    decoded_line = log_line.decode('utf-8').rstrip()
                    self.log('debug', f'[inside container] {decoded_line}')
        except Exception as e:
            self.log('error', f'Error streaming docker logs to stdout: {e}')
Stream logs from the Docker container to stdout.
openhands/runtime/utils/log_streamer.py