public function flush()
    {
        foreach ($this->buffer as $data) {
            $this->output->write($data['messages'], $data['newline'], $data['options']);
        }

        // Clear the buffer array.
        $this->buffer = [];
    }