diff --git a/R/handlers.R b/R/handlers.R index ddb5a3cc2..6a429a583 100644 --- a/R/handlers.R +++ b/R/handlers.R @@ -3,18 +3,17 @@ handle_build_exceptions <- function(target, meta, config) { warn_opt <- max(1, getOption("warn")) withr::with_options( new = list(warn = warn_opt), - drake_warning( + warning( "target ", target, " warnings:\n", multiline_message(meta$warnings), - config = config + call. = FALSE ) ) } if (length(meta$messages) && config$verbose) { - drake_message( + message( "Target ", target, " messages:\n", - multiline_message(meta$messages), - config = config + multiline_message(meta$messages) ) } if (inherits(meta$error, "error")) { diff --git a/R/run.R b/R/run.R index d6dd8fd66..7b0139fc7 100644 --- a/R/run.R +++ b/R/run.R @@ -23,10 +23,12 @@ with_handling <- function(target, meta, config) { withCallingHandlers( value <- with_call_stack(target = target, config = config), warning = function(w) { + drake_log_warning(w$message, config = config) warnings <<- c(warnings, w$message) }, message = function(m) { msg <- gsub(pattern = "\n$", replacement = "", x = m$message) + drake_log_message(msg, config = config) messages <<- c(messages, msg) } ),