Tracing Functions in Python
Sometimes I want to debug the inputs and outputs of function calls to visualize flow or to follow execution passively.
Rather than adding logging statements and littering them around the code, a single decorator can be crafted to show the life cycle of a function:
def trace_args(f): def wrapper …more ...