addLogger(name, threshold, appender, layout)
getLogger(name = 'ROOT', failfast = FALSE)
loggerAppender(name)
loggerThreshold(name)
> lg <- getLogger() > lg(DEBUG, "A debug message")
Typically, the built in log level constants are used in the call, which conform to the log4j levels (from least severe to most severe): TRACE, DEBUG, INFO, WARN, ERROR, FATAL. It is not a strict requirement to use these constants (any numeric value will work), though most users should find this level of granularity sufficient.
Loggers are hierarchical in the sense that any requested logger that is undefined will fall back to its most immediate defined parent logger. The absolute parent is ROOT, which _must_ be defined for the system to work.
'getLogger' constructs a logger function based on the registered configuration
'loggerAppender' provides introspection on the appenders attached to a logger
'loggerThreshold' provides the threshold of the logger
lg <- getLogger("some.package")
lg(DEBUG, "A debug message")
Run the code above in your browser using DataLab