Learn R Programming

futile.logger (version 1.3.7)

flog.layout: Manage layouts within the 'futile.logger' sub-system

Description

Provides functions for managing layouts. Typically 'flog.layout' is only used when manually creating a logging configuration.

Arguments

...
Used internally by lambda.r

Usage

# Get the layout function for the given logger flog.layout(name) %::% character : Function flog.layout(name='ROOT')

# Set the layout function for the given logger flog.layout(fn, name='ROOT')

# Decorate log messages with a standard format layout.simple(level, msg, ...)

# Decorate log messages using a custom format layout.format(format, datetime.fmt=" # Show the value of a single variable layout.tracearg(level, msg, ...)

See Also

flog.logger flog.appender

Examples

Run this code
# Set the layout for 'my.package'
flog.layout(layout.simple, name='my.package')

# Update the ROOT logger to use a custom layout
layout <- layout.format('[~l] [~t] [~n.~f] ~m')
flog.layout(layout)

# Create a custom logger to trace variables
flog.layout(layout.tracearg, name='tracer')
x <- 5
flog.info(x, name='tracer')

Run the code above in your browser using DataLab