Learn R Programming

lgr (version 0.2.0)

get_logger: Get/Create a Logger

Description

Get/Create a Logger

Usage

get_logger(name, class = Logger)

get_logger_glue(name)

Arguments

name

a character scalar or vector: The qualified name of the Logger as a hierarchical value.

class

An R6ClassGenerator object. Usually Logger or LoggerGlue are the only valid choices.

Value

a Logger

Examples

Run this code
# NOT RUN {
lg <- get_logger("log/ger/test")
# equivalent to
lg <- get_logger(c("log", "get", "test"))
lg$warn("a %s message", "warning")
lg
lg$parent

lg <- get_logger_glue("log/ger")
lg$warn("a {.text} message", .text = "warning")
# }

Run the code above in your browser using DataLab