set_referee | R Documentation |
set_referee
is a helper function to set the 'referee' of the baton; this controls what threshold of content is written to the logbook. The
updated metadata will occur both in the source YAML as well as the R object for paired consistency.
set_referee(
baton,
threshold = getOption("relay_referee", default = "TRACE"),
suppressWarnings = TRUE,
autoassign = TRUE,
envir = .GlobalEnv,
...
)
baton |
R object of S3 class, created by |
threshold |
character value for the minimum threshold for logging to occur (e.g. 'TRACE', 'DEBUG', 'MESSAGE', 'WARNING', 'ERROR'). |
suppressWarnings |
boolean value to determine if warning messages upon YAML write are ignored. |
autoassign |
boolean value to determine if the passed baton is also refreshed automatically. Recommended as TRUE to avoid having to do manual assignment to provided baton. |
envir |
Environment where baton exists, default set to .GlobalEnv, only needed when autoassign is TRUE. If deploying on RStudio Connect, may require using |
... |
Additional parameters passed to |
The default threshold is set to 'TRACE'
and can be overriden directly or by setting the global options via options(relay_referee = 'TRACE')
.
S3 class object.
## Not run:
my_baton <- create_baton()
set_referee(my_baton, 'MESSAGE')
write_logbook(my_baton, 'A super important message')
set_referee(my_baton, 'ERROR')
write_logbook(my_baton, 'This message ignored b/c the referee cares not')
read_logbook(my_baton)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.