A layout function to be used with an appender. This layout adds the time to the message.
layoutTimestamp(level, message)
The level of the message (e.g. "INFO")
The message to layout.
appender <- createConsoleAppender(layout = layoutTimestamp)
logger <- createLogger(name = "SIMPLE",
threshold = "INFO",
appenders = list(appender))
registerLogger(logger)
logTrace("This event is below the threshold (INFO)")
logInfo("Hello world")
#> 2024-08-23 08:25:55 Hello world
#> 2024-08-23 08:25:55 Hello world
unregisterLogger("SIMPLE")
#> [1] TRUE