'Reads output until the prompt is encountered.
This keyword requires the prompt to be [#Configuration|configured]
either in `importing` or with `Open Connection` or `Set Prompt` keyword.
By default, text up to and including the prompt is returned and logged.
If no prompt is found, this keyword fails. How much to wait for the
output depends on the [#Configuration|configured timeout].
If you want to exclude the prompt from the returned output, set
``strip_prompt`` to a true value (see `Boolean arguments`). If your
prompt is a regular expression, make sure that the expression spans the
whole prompt, because only the part of the output that matches the
regular expression is stripped away.
See `Logging` section for more information about log levels.
Optionally stripping prompt is a new feature in Robot Framework 2.8.7.'

def read_until_prompt(self, loglevel=None, strip_prompt=False):

    if (not self._prompt_is_set()):
        raise RuntimeError('Prompt    is    not    set.')
    (success, output) = self._read_until_prompt()
    self._log(output, loglevel)
    if (not success):
        (prompt, regexp) = self._prompt
        raise AssertionError(("Prompt    '%s'    not    found    in    %s." % ((prompt if (not regexp) else prompt.pattern), secs_to_timestr(self._timeout))))
    if is_truthy(strip_prompt):
        output = self._strip_prompt(output)
    return output
