Skip to content

Commit

Permalink
More diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Aug 6, 2024
1 parent 0850cc6 commit 0dd13fb
Show file tree
Hide file tree
Showing 3 changed files with 435 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/formatters.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ formatter_sprintf <- structure(function(fmt, ..., .logcall = sys.call(), .topcal
#' @importFrom utils str
formatter_glue <- structure(function(..., .logcall = sys.call(), .topcall = sys.call(-1), .topenv = parent.frame()) {
fail_on_missing_package('glue')
cat("Inside formatter_glue\n", file = stderr())

withCallingHandlers(
glue::glue(..., .envir = .topenv),
error = function(e) {
Expand Down Expand Up @@ -233,6 +235,7 @@ formatter_logging <- structure(function(..., .logcall = sys.call(), .topcall = s
#' @seealso This is a [log_formatter()], for alternatives, see [formatter_paste()], [formatter_sprintf()], [formatter_glue()], [formatter_glue_safe()], [formatter_glue_or_sprintf()], [formatter_logging()]
formatter_pander <- structure(function(x, ..., .logcall = sys.call(), .topcall = sys.call(-1), .topenv = parent.frame()) {

cat("inside formatter_pander\n", file = stderr())
fail_on_missing_package('pander')
eval(pander::pander_return(x, ...), envir = .topenv)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-CRANSKIP-hooks.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ eval_outside <- function(expr) {
"log_errors()",
expr
))
writeLines(readLines(input), con = stderr())

path <- file.path(R.home("bin"), "Rscript")
if (Sys.info()[["sysname"]] == "Windows") {
Expand Down
Loading

0 comments on commit 0dd13fb

Please sign in to comment.