LoggerGlue {lgr}R Documentation

LoggerGlue

Description

LoggerGlue

LoggerGlue

Details

LoggerGlue uses glue::glue() instead of base::sprintf() to construct log messages. glue is a very well designed package for string interpolation. It makes composing log messages more flexible and comfortable at the price of an additional dependency and slightly less performance than sprintf().

glue() lets you define temporary named variables inside the call. As with the normal Logger, these named arguments get turned into custom fields; however, you can suppress this behaviour by making named argument start with a ".". Please refer to vignette("lgr", package = "lgr") for examples.

Super classes

lgr::Filterable -> lgr::Logger -> LoggerGlue

Methods

Public methods

Inherited methods

Method new()

Usage
LoggerGlue$new(
  name = "(unnamed logger)",
  appenders = list(),
  threshold = NULL,
  filters = list(),
  exception_handler = default_exception_handler,
  propagate = TRUE,
  replace_empty = "<NULL>",
  transformer = NULL
)

Method fatal()

Usage
LoggerGlue$fatal(..., caller = get_caller(-8L), .envir = parent.frame())

Method error()

Usage
LoggerGlue$error(..., caller = get_caller(-8L), .envir = parent.frame())

Method warn()

Usage
LoggerGlue$warn(..., caller = get_caller(-8L), .envir = parent.frame())

Method info()

Usage
LoggerGlue$info(..., caller = get_caller(-8L), .envir = parent.frame())

Method debug()

Usage
LoggerGlue$debug(..., caller = get_caller(-8L), .envir = parent.frame())

Method trace()

Usage
LoggerGlue$trace(..., caller = get_caller(-8L), .envir = parent.frame())

Method log()

Usage
LoggerGlue$log(
  level,
  ...,
  timestamp = Sys.time(),
  caller = get_caller(-7),
  .envir = parent.frame()
)

Method list_log()

Usage
LoggerGlue$list_log(x)

Method spawn()

Usage
LoggerGlue$spawn(name)

Method set_transformer()

Set the transformer for glue string interpolation

Usage
LoggerGlue$set_transformer(x)
Arguments
x

single function taking two arguments. See glue::glue().


[Package lgr version 0.5.0 Index]