paws_config_log: paws logging system

View source: R/logging.R

paws_config_logR Documentation

paws logging system

Description

Ability to configure paws logging system, through the use of paws helper function `paws_config_log` or R:base options function. Users are able to change logging levels without calling paws.common by the use of options e.g. options("paws.log_level" = 2L).

  • paws.log_level (integer): The minimum log level that should be tracked

  • paws.log_file (character): path for logs to populate, default output logs to console.

  • paws.log_timestamp_fmt (character): see format.POSIXct()

Usage

paws_config_log(
  level = 2L,
  file = "",
  timestamp_fmt = "%Y-%m-%d %H:%M:%OS3"
)

Arguments

level

(integer) to determine the level logging threshold.

  • 4L: DEBUG

  • 3L: INFO

  • 2L: WARNING

  • 1L: ERROR

file

(character) path for logs to populate, default output logs to console.

timestamp_fmt

(character) for timestamp format, see format.POSIXct().

Examples

# log to a file
temp_file <- tempfile()
paws_config_log(file = temp_file)
unlink(temp_file)

# change log threshold to INFO
paws_config_log(level = 3L)

# reset to default config
paws_config_log()

paws.common documentation built on Oct. 4, 2024, 1:08 a.m.