Execute an expression with structured error and warning logging
with_logging.RdWraps expr in a tryCatch() that:
logs warnings via
logger::log_warn()and re-issues them so Shiny can also handle themlogs errors via
logger::log_error()and re-throws so the caller / Shiny sees the error normally
Examples
if (FALSE) { # \dontrun{
result <- with_logging(
context = "my_module / compute",
ns = "tooltipexplorer/app",
sqrt(4)
)
} # }