def consume(the_plot):
    """Obtain messages logged by game entities since the last call to `consume`.

  This function is meant to be called by "game engine users" (user interfaces,
  environment interfaces, etc.) to obtain the latest set of log messages
  emitted by the game entities. These systems can then dispose of these messages
  in whatever manner is the most appropriate.

  Args:
    the_plot: the pycolab game's `Plot` object.

  Returns:
    The list of all log messages supplied by the `log` method since the last
    time `consume` was called (or ever, if `consume` has never been called).
  """
    messages = the_plot.setdefault('log_messages', [])
    our_messages = messages[:]
    del messages[:]
    return our_messages
