handlers {loggit}R Documentation

loggit's Exception Handlers

Description

These exception handlers are identical to base R's message, warning, and stop, but with included logging of the exception messages via loggit().

Usage

message(..., domain = NULL, appendLF = TRUE, .loggit = TRUE, echo = TRUE)

warning(
  ...,
  call. = TRUE,
  immediate. = FALSE,
  noBreaks. = FALSE,
  domain = NULL,
  .loggit = TRUE,
  echo = TRUE
)

stop(..., call. = TRUE, domain = NULL, .loggit = TRUE, echo = TRUE)

Arguments

...

zero or more objects which can be coerced to character (and which are pasted together with no separator) or (for message only) a single condition object.

domain

see gettext. If NA, messages will not be translated, see also the note in stop.

appendLF

logical: should messages given as a character string have a newline appended?

.loggit

Should loggit function execute? Defaults to TRUE.

echo

Should loggit's log entry be echoed to the console, as well? Defaults to TRUE.

call.

logical, indicating if the call should become part of the warning message.

immediate.

logical, indicating if the call should be output immediately, even if getOption("warn") <= 0.

noBreaks.

logical, indicating as far as possible the message should be output as a single line when options(warn = 1).

Examples

  if (2 < 1) message("Don't say such silly things!")

  if (2 < 1) warning("You may want to review that math, and so this is your warning")

  if (2 < 1) stop("This is a completely false condition, which throws an error")


[Package loggit version 2.1.1 Index]