View source: R/register_handlers.R
register_handlers | R Documentation |
Register handlers for logging messages, warnings and errors
register_handlers(namespace, package = namespace)
namespace |
( |
package |
( |
This function registers global handlers for messages, warnings and errors. The handlers will investigate the call stack and if it contains a function from the package, the message, warning or error will be logged into the respective namespace.
The handlers are registered only once per package and type. Consecutive calls will no effect.
Registering handlers for package base
is not supported.
Use TEAL.LOG_MUFFLE
environmental variable or teal.log_muffle
R option to optionally
control recover strategies. If TRUE
(a default value) then the handler will jump to muffle
restart for a given type of condition and doesn't continue (with output to the console).
Applicable for message and warning types only. The errors won't be suppressed.
NULL
invisibly. Called for its side effects.
Registering handlers is forbidden within tryCatch()
or withCallingHandlers()
.
Because of this, handlers are registered only if it is possible.
globalCallingHandlers()
## Not run:
register_handlers("teal.logger")
# see the outcome
globalCallingHandlers()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.