log4r-package: A simple logging system for R, based on log4j.

Description Details References Examples

Description

logr4 provides an object-oriented logging system that uses an API roughly equivalent to log4j and its related variants.

Details

Package: log4r
Type: Package
Version: 0.2
Date: 2014-09-29
License: Artistic-2.0
LazyLoad: yes

Maintainer: Kirill Müller <krlmlr+r@mailbox.org>

URL: https://github.com/johnmyleswhite/log4r

Issue tracker: https://github.com/johnmyleswhite/log4r/issues

References

See the log4j documentation or the documentation for its many derivatives to understand the origins of this logging system.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Import the log4r package.
library('log4r')

# Create a new logger object with create.logger().
logger <- create.logger()

# Set the logger's file output.
logfile(logger) <- 'base.log'

# Set the current level of the logger.
level(logger) <- 'INFO'

# Try logging messages with different priorities.
# At priority level INFO, a call to debug() won't print anything.
debug(logger, 'A Debugging Message')
info(logger, 'An Info Message')
warn(logger, 'A Warning Message')
error(logger, 'An Error Message')
fatal(logger, 'A Fatal Error Message')

log4r documentation built on Jan. 18, 2020, 9:06 a.m.