lg <- get_logger("test")
lg$error("foo bar")
# The last LogEvent produced by a Logger is stored in its `last_event` field
lg$last_event # formatted console output
lg$last_event$values # values stored in the event
# Also contains the Logger that created it as .logger
lg$last_event$logger
# equivalent to
lg$last_event$.logger$name
# This is really a reference to the complete Logger, so the following is
# possible (though nonsensical)
lg$last_event$.logger$last_event$msg
identical(lg, lg$last_event$.logger)
lg$config(NULL) # reset logger config
Run the code above in your browser using DataLab