diff --git a/R/notify_loggr.R b/R/notify_loggr.R index fb46565..84bf950 100644 --- a/R/notify_loggr.R +++ b/R/notify_loggr.R @@ -13,14 +13,18 @@ notify_loggr <- function(..., type = "other", muffled = FALSE) args <- list(...) if (inherits(args[[1L]], "condition")) { cond <- args[[1L]] - } else if (type == "error") { + } else { + message = unlist(args) + message = paste0(message[1:(length(message)-3)],collapse='') + if (type == "error") { # Can we get the call here? - cond <- simpleError(.makeMessage(args[[1L]], domain = args[["domain"]])) - } else if (type == "warning") { + cond <- simpleError(.makeMessage(message, domain = args[["domain"]])) + } else if (type == "warning") { # Can we get the call here? - cond <- simpleWarning(.makeMessage(args[[1L]], domain = args[["domain"]])) - } else { - cond <- simpleCondition(.makeMessage(args[[1L]], domain = args[["domain"]])) + cond <- simpleWarning(.makeMessage(message, domain = args[["domain"]])) + } else { + cond <- simpleCondition(.makeMessage(message, domain = args[["domain"]])) + } } le <- as_log_event(cond)