smdocker_log {smdocker}R Documentation

smdocker logging system

Description

Ability to configure smdocker logging system, through the use of smdocker helper function smdocker_log or R:base options function. options configurable parameters:

Usage

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

Arguments

level

(integer): 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): timestamp format, see format.POSIXct().

Value

NULL invisible

Examples

## Not run: 
# log to a file
temp_file <- tempfile()
smdocker_log(file = temp_file)

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

# reset to default config
smdocker_log()

# options() equivalents:

# log to a file
temp_file <- tempfile()
options(smdocker.log_file = temp_file)

# change log threshold to INFO
options(smdocker.log_level = 3L)

## End(Not run)

[Package smdocker version 0.1.4 Index]