log_error {rjtools} | R Documentation |
Logging functions
Description
log_...
functions produce a log entry.
journal_summary
prints a quick summary (status
counts) based on the journal.
simplify_journal
returns a simplified form of the
results in the journal.
Usage
log_error(
text,
...,
output = getOption("check.log.output", "cli"),
file = getOption("check.log.file", NULL),
signal = getOption("check.log.conditions", FALSE),
.envir = parent.frame()
)
log_success(
text,
...,
output = getOption("check.log.output", "cli"),
file = getOption("check.log.file", NULL),
signal = getOption("check.log.conditions", FALSE),
.envir = parent.frame()
)
log_note(
text,
...,
output = getOption("check.log.output", "cli"),
file = getOption("check.log.file", NULL),
signal = getOption("check.log.conditions", FALSE),
.envir = parent.frame()
)
log_warning(
text,
...,
output = getOption("check.log.output", "cli"),
file = getOption("check.log.file", NULL),
signal = getOption("check.log.conditions", FALSE),
.envir = parent.frame()
)
journal_summary(journal = getOption("check.log.journal"), file = stdout())
simplify_journal(journal = getOption("check.log.journal"))
Arguments
text |
string, description of the error that occurred,
will be passed to |
... |
additional inputs for text passed to the |
output |
type of the output, can either a string ( |
file |
connection to log a copy of the output to or NULL
(default) if no additional copy is desired. It uses the
|
signal |
logical, if |
.envir |
the environment used to find the text string replacements |
journal |
environment of the journal |
Details
Most arguments are intended to be set with options to allow the use
of the checking mechanism both in interactive and automated
settings. There are four types of log entries: SUCCESS, NOTE,
WARNING and ERROR. If the "check.log.journal"
option is set
to an environment then the entry is also added to the journal.
Value
log_...
string with the result type. The
corresponding condition object with a message and call is
included in the "info"
attribute (even if no condition
is signalled).
journal_summary
table of the status counts
simplify_journal
string matrix with columns "result"
(status), "test" (name of the calling function) and "message"