Returns  a string with the history. Set metadata to True to have info on function and module.

def to_string(self, metadata=False):
        """Returns  a string with the history. Set metadata to True to have info on function and module."""
        return "\n".join(rec.get_message(metadata=metadata) for rec in self)