Skip to content

Add convenience functions to activate other major logging packages #42

@aryoda

Description

@aryoda

#10 introduced the possibility to inject your own logging functions.

There are many logging packages at CRAN now.

It would be very convenient if tryCatchLog provides functions to activate one of these logging packages with a simple function call.

List of known logging frameworks for R (updated in-place):

  • plogr allows logging within C++ code into R' standard error stream (via the REprintf() function. This logging framework seems not to be meant for R code itself!.
  • futile.logger: logging to files, console
  • logging: Powerful R port of the popular Python logging package. Logging to console, file, sentry server etc.
  • logger (by daroczik): A lightweight, modern and flexibly logging utility for R -- heavily inspired by the futile.logger R package and logging Python module. Under active development (put on watch list ;-). Lists many other logging frameworks.
  • debugme ("zero"-overhead logging and easy debug strings with embedded R code!)
  • logR: transactional logging to databases and email notifications
  • loggr: logging to files, console
  • logr: logging to files
  • dtq: detailed auditing of data.table queries
  • loggit
  • rlogging
  • log4r
  • rsyslog for POSIX-compatible OSes
  • lgr: a logging package for R built on the back of R6 classes. Supports logging of data in objects.

See also:

https://www.r-bloggers.com/effortless-but-powerful-exception-logging-in-r-loggit-1-0-0-released-on-cran/

CRAN download statistics:

library(cranlogs)
library(data.table)
res <- cran_downloads(when = "last-month", packages = c("futile.logger", "logging", "logR", "logr", "loggr", "dtq", "loggit", "rlogging", "log4r", "rsyslog", "luzlogr", "debugme", "plogr", "logger", "lgr"))
setDT(res)
res[, .(.N, downloads = sum(count)), by = .(package)][downloads > 0,][order(-downloads),]

shows two major packages and a newcomer (debugme) - last updated July 22, 2022 (with lgr, logR added):

          package  N downloads
 1: futile.logger 30    178068
 2:         plogr 30     88917
 3:        logger 30     25768
 4:       logging 30     25201
 5:           lgr 30     14701
 6:       debugme 30     14253
 7:         log4r 30     13096
 8:          logr 30      1470
 9:        loggit 30       729
10:       rsyslog 30       647
11:       luzlogr 30       378

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions