def flush_log(console):
    """Flush console output log buffer.

    Console output is written to the log when end of line is reached. Call this
    function when you want to log the latest console output but the end of the
    last line has not been reached yet.

    .. note::

       In order to support this operation the
       :py:attr:`pexpect:pexpect.spawn.logfile_read` console attribute must be
       set to :py:class:`alpy.pexpect_log.LogfileRead` instance. The console
       objects returned by :py:func:`alpy.console.create` and
       :py:func:`alpy.console.connect` functions are configured in this way.

    :param console: console object
    :type console: :py:class:`pexpect:pexpect.spawn` - like class
    """
    console.logfile_read.log_remaining_text()
