Skip to contents

Wraps expr in a tryCatch() that:

Usage

with_logging(expr, context = "", ns = "tooltipexplorer/app")

Arguments

expr

Expression to evaluate (passed unevaluated via ...).

context

Short string identifying the call site, e.g. "mod_outputs / prices_r". Prepended to every log message.

ns

Logger namespace string. Defaults to "tooltipexplorer/app".

Value

The value of expr on success; re-throws on error.

Examples

if (FALSE) { # \dontrun{
result <- with_logging(
  context = "my_module / compute",
  ns      = "tooltipexplorer/app",
  sqrt(4)
)
} # }