human
Complete this python program:
def fail_gracefully(f):
assistant
#Here is the Python program you requested.

    """Log exceptions and aborts.
    """
    @functools.wraps(f)
    def wrapper(*args, **kw):
        try:
            return f(*args, **kw)
        except Exception as e:
            LOG.debug(e, exc_info=True)
            LOG.critical(e)
            sys.exit(1)
    return wrapper