<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def graceful(cls):
 """ A decorator to protect against message structure changes. Many of our processors expect messages to be in a certain format. If the format changes, they may start to fail and raise exceptions. This decorator is in place to catch and log those exceptions and to gracefully return default values. """

    def _wrapper(f):
        @functools.wraps(f)
        def __wrapper(msg, **config):
            try:
                return f(msg, **config)
            except KeyError:
                log.exception("%r failed on %r" % (f, msg.get('msg_id')))
                return cls()

        return __wrapper
    return _wrapper