def log_calls(call, print_func, errors=True, stack=True, repr_len=REPR_LEN):
    """Logs or prints all function calls,
       including arguments, results and raised exceptions."""
    signature = signature_repr(call, repr_len)
    try:
        print_func('Call %s' % signature)
        result = call()
        # NOTE: using full repr of result
        print_func('-> %s from %s' % (smart_repr(result, max_len=None), signature))
        return result
    except BaseException as e:
        if errors:
            print_func('-> ' + _format_error(signature, e, stack))
        raise
Logs or prints all function calls,
       including arguments, results and raised exceptions.
funcy/debug.py