Ejemplo n.º 1
0
def log_hook():
    """Log when a hook starts and stops its execution.

    Also log to stdout possible CalledProcessError exceptions raised executing
    the hook.
    """
    script = script_name()
    log(">>> Entering {}".format(script))
    try:
        yield
    except CalledProcessError as err:
        log('Exception caught:')
        log(err.output)
        raise
    finally:
        log("<<< Exiting {}".format(script))
Ejemplo n.º 2
0
def log_hook():
    """Log when a hook starts and stops its execution.

    Also log to stdout possible CalledProcessError exceptions raised executing
    the hook.
    """
    script = script_name()
    log(">>> Entering {}".format(script))
    try:
        yield
    except CalledProcessError as err:
        log('Exception caught:')
        log(err.output)
        raise
    finally:
        log("<<< Exiting {}".format(script))
Ejemplo n.º 3
0
def log_exit():
    log("<-- Exiting {}".format(script_name()))
Ejemplo n.º 4
0
def log_entry():
    log("--> Entering {}".format(script_name()))
Ejemplo n.º 5
0
def log_exit():
    log("<-- Exiting {}".format(script_name()))
Ejemplo n.º 6
0
def log_entry():
    log("--> Entering {}".format(script_name()))