Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

use_logger

Setup a Simple Logger for a Package


Description

This gives you a minimal logger with no appenders that you can use inside your package under the name lg (e.g. lg$fatal("test")). use_logger() does not modify any files but only prints code for you to copy and paste.

Usage

use_logger(
  pkg = desc::desc_get("Package",
    rprojroot::find_package_root_file("DESCRIPTION"))[[1]]
)

Arguments

pkg

character scalar. Name of the package. The default is to try to get the Package name automatically using the packages rprojroot and desc

Value

a character scalar containing R code.

Examples

use_logger("testpkg")

lgr

A Fully Featured Logging Framework

v0.4.2
MIT + file LICENSE
Authors
Stefan Fleck [aut, cre] (<https://orcid.org/0000-0003-3344-9851>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.