bru_log_message {inlabru} | R Documentation |
Add a log message
Description
Adds a log message.
Usage
bru_log_message(
...,
domain = NULL,
appendLF = TRUE,
verbosity = 1L,
allow_verbose = TRUE,
verbose = NULL,
verbose_store = NULL,
x = NULL
)
Arguments
... |
For |
domain |
Domain for translations, passed on to |
appendLF |
logical; whether to add a newline to the message. Only used for verbose output. |
verbosity |
numeric value describing the verbosity level of the message |
allow_verbose |
Whether to allow verbose output. Must be set to FALSE until the options object has been initialised. |
verbose |
logical, numeric, or |
verbose_store |
Same as |
x |
A |
Value
bru_log_message
returns invisible(x)
, where x
is the updated bru_log
object, or NULL
.
See Also
Other inlabru log methods:
bru_log()
,
bru_log_bookmark()
,
bru_log_new()
,
bru_log_offset()
,
bru_log_reset()
Examples
if (interactive()) {
code_runner <- function() {
local_bru_options_set(
# Show messages up to and including level 2 (default 0)
bru_verbose = 2,
# Store messages to an including level 3 (default Inf, storing all)
bru_verbose_store = 3
)
bru_log_bookmark("bookmark 1")
bru_log_message("Test message 1", verbosity = 1)
bru_log_message("Test message 2", verbosity = 2)
bru_log_bookmark("bookmark 2")
bru_log_message("Test message 3", verbosity = 3)
bru_log_message("Test message 4", verbosity = 4)
invisible()
}
message("Run code")
code_runner()
message("Check log from bookmark 1")
print(bru_log()["bookmark 1"])
message("Check log from bookmark 2")
print(bru_log()["bookmark 2"])
}