loggit {loggit2} | R Documentation |
Log messages and R objects
Description
Log messages and R objects to a ndjson log file.
Usage
loggit(
log_lvl,
log_msg,
...,
echo = get_echo(),
custom_log_lvl = FALSE,
logfile = get_logfile(),
ignore_log_level = FALSE
)
Arguments
log_lvl |
Log level. A atomic vector of length one (usually |
log_msg |
Log message. A atomic vector of length one (usually |
... |
Named arguments, each a atomic vector of length one, you wish to log. Will be coerced to |
echo |
Should the log entry (json) be echoed to |
custom_log_lvl |
Allow log levels other than "DEBUG", "INFO", "WARN", and "ERROR"? |
logfile |
Path of log file to write to. |
ignore_log_level |
Ignore the log level set by |
Value
Invisible NULL
.
Examples
## Not run:
loggit("DEBUG", "This is a message")
loggit("INFO", "This is a message", echo = FALSE)
loggit("CUSTOM", "This is a message of a custom log_lvl", custom_log_lvl = TRUE)
loggit(
"INFO", "This is a message", but_maybe = "you want more fields?",
sure = "why not?", like = 2, or = 10, what = "ever"
)
## End(Not run)
[Package loggit2 version 2.3.1 Index]