porcelain_logger: Create logger

View source: R/logging.R

porcelain_loggerR Documentation

Create logger

Description

Create a json-emitting logger, using the 'lgr' package.

Usage

porcelain_logger(log_level = "info", name = NULL, path = NULL)

Arguments

log_level

The level of detail to log to. See lgr::get_log_levels() for possible values; this could be a string ("off", "info", "all", etc) or an integer level.

name

The name of the logger. By default we use one derived from the package name, though this may not always be accurate.

path

Optionally, the path to log into. If not given then we log to the console.

Value

A "Logger" object (see lgr::Logger)

Examples

logger <- porcelain::porcelain_logger(name = "example")
logger$log("info", "hello")
logger$log("trace", "silent")

reside-ic/porcelain documentation built on March 4, 2024, 11:11 p.m.