lg <- get_logger("test")
lg$info("lorem ipsum")
as.data.frame(lg$last_event)
lg$info("LogEvents can store any custom log values", df = iris)
as.data.frame(lg$last_event)
head(as.data.frame(lg$last_event)$df[[1]])
# how boxing works
# by default non-scalars are boxed
lg$info("letters", letters = letters)
as.data.frame(lg$last_event)
# this behaviour can be modified by supplying a custom boxing function
as.data.frame(lg$last_event, box_if = function(.) FALSE)
as.data.frame(lg$last_event, cols_expand = "letters")
# The `msg` argument of a log event is always vectorized
lg$info(c("a vectorized", "log message"))
as.data.frame(lg$last_event)
lg$config(NULL)
Run the code above in your browser using DataLab