I am looking for the standard (if any) logging package for R, and some sample usage?
I also don't see any among the packages listed: http://cran.r-project.org/web/packages/
I am looking for the standard (if any) logging package for R, and some sample usage?
I also don't see any among the packages listed: http://cran.r-project.org/web/packages/
I suggest the
futile.logger
package, it implements multiple hierarchical loggers with formatted output strings and you can send the output different ways. It also implements per-package loggers naturally.The in-built (package base) functions are "warning", "message", "stop". These functions support multiple languages. If you want to log to a file, maybe you could use these functions together with "sink".
Searching with RSeek brought up the package futile with a logger functionality.
At the moment, there is still no native library for logging. But there are four of them available on CRAN:
1) logging
- simple & log4j-like
- resembles standard Python library
- not maintaining since 2013, some issues detected upper
2) futile.logger (recommended! I am also using it)
- actively maintaining
- supports json error logging
- similar semantics to Python’s logging as well as log4j-like
- may be complicated
3) log4r
- easy and log4j-like
- not being maintained since 2014
4) luzlogr
- supersimple - (open, write, close file)
I just submitted a
logging
package to CRAN. it is based on some parts of an older version of the 'futile' package (by Brian Lee Yung Rowe).You find the
logging
package:It mimics the standard python
logging
package, but please be careful if you decide to use it. I also attempted to document it by example, the package home page on R-Forge points to a couple of possible usage sessions.Any feedback will be read with interest!
I'm not aware of any, so I was about to release a wrapper for log4j in the next few days (I've been testing it for a while now). I'll let you know when it's available.
A simpler alternative compared to
logging
andfutile.logger
:log4r
(cran, github)