Wraps f with a lightweight logger emitting "call", "success",
and "error" events. The default logger uses cli alerts. Errors are
logged and re-raised unchanged.
Arguments
- f
A function to wrap.
- ...
Reserved for future extension.
- .logger
Optional user function
function(event, data);eventis one of"call","success","error";datais a list with at leastname, plus event-specific fields. DefaultNULLuses cli.- .log_args
Logical. Whether to include a short deparse of the arguments in the
"call"event. DefaultTRUE.- .log_result
Logical. Whether to include a short deparse of the return value in the
"success"event. DefaultFALSE.- .name
Optional character name to display for the function. Defaults to the deparsed
fsymbol.
See also
Other decorators:
cache_clear(),
decorate(),
fmisc_decorators,
is_decorated(),
print.fmisc_decorated(),
undecorate(),
with_cache(),
with_rate_limit(),
with_retry(),
with_timing()