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

    """Logs exceptions and aborts.
    """
    @functools.wraps(f)
    def wrapper(*args, **kw):
        try:
            return f(*args, **kw)
        except Exception as e:
            logging.debug(traceback.format_exc(e))
            logging.critical(e)
            exit(1)
    return wrapper