log_warnings: Log Warning Messages in the Console

View source: R/log_warnings.R

log_warningsR Documentation

Log Warning Messages in the Console

Description

The log_warnings() function prints any warning messages or errors generated by the enclosed expression to the console. Besides the message text itself, the date and timestamp are displayed, in an easy-to-read, Java-like format. If a warning is the result of faulty input data, the exact cell locations responsible are indicated. It was adapted from https://stackoverflow.com/questions/1975110/printing-stack-trace-and-continuing-after-error-occurs-in-r. The original function was written by Alice Purcell (https://stackoverflow.com/users/125663/alice-purcell), distributed to Stack Overflow with permission from the Man Group.

Usage

log_warnings(expr, silentSuccess = FALSE, stopIsFatal = TRUE)

Arguments

expr

line(s) of code, any warnings generated by which will be logged in the format facilitated by log_warnings


iAM-AMR/sawmill documentation built on June 30, 2024, 2:25 a.m.