layoutTimestamp: Logging layout with timestamp

View source: R/Layouts.R

layoutTimestampR Documentation

Logging layout with timestamp

Description

A layout function to be used with an appender. This layout adds the time to the message.

Usage

layoutTimestamp(level, message)

Arguments

level

The level of the message (e.g. "INFO")

message

The message to layout.

Examples

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")                       
unregisterLogger("SIMPLE")                     

ParallelLogger documentation built on Aug. 22, 2023, 5:11 p.m.