loggit {loggit2} | R Documentation |
Log entries to a ndjson log file, defined by set_logfile()
.
loggit(
log_lvl,
log_msg,
...,
echo = TRUE,
custom_log_lvl = FALSE,
sanitizer = default_ndjson_sanitizer
)
log_lvl |
Log level coerceable to |
log_msg |
Main log message. Will be coerced to class |
... |
Named arguments, each a atomic vector of length one, you wish to log. The names of the arguments are treated as column names in the log. |
echo |
Should the log file entry be printed to the console as well?
Defaults to |
custom_log_lvl |
Allow log levels other than "DEBUG", "INFO", "WARN",
and "ERROR"? Defaults to |
sanitizer |
Sanitizer function to run over elements in log data.
Defaults to |
Invisible NULL
.
loggit("INFO", "This is a message", but_maybe = "you want more fields?",
sure = "why not?", like = 2, or = 10, what = "ever")