Learn R Programming

loggit2 (version 2.4.0)

debuginfo: Debug Log Handler

Description

This function works like base R's warning , but is silent, includes logging of the exception message via loggit() and does not allow conditions as input.

Usage

debuginfo(..., call. = TRUE, .loggit = NA, echo = get_echo())

Value

No return value.

Arguments

...

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

call.

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

.loggit

Should the condition message be added to the log? If NA the log level set by set_log_level() is used to determine if the condition should be logged.

echo

Should the log entry (json) be echoed to stdout as well?

Details

This function is more than just a wrapper around loggit() with a log level of "DEBUG". It has the ability to track the call stack and log it if call. is set to TRUE and to automatically translate the input into a message using .makeMessage(), like warning() does.

See Also

Other handlers: message(), stop(), stopifnot(), warning()

Examples

Run this code
if (FALSE) {
  debuginfo("This is a completely false condition")

  debuginfo("This is a completely false condition", echo = FALSE)
}

Run the code above in your browser using DataLab