handle_condition: Handle conditions and logging

Description Usage Arguments Functions

View source: R/logging.R

Description

Minimal logging and error handling.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
handle_condition(bool, msg, pfx = 1, retcode = 0, threshold = 2)

handle_debug(bool, msg)

handle_info(bool, msg)

handle_warning(bool, msg)

handle_error(bool, msg, stop = TRUE)

log_debug(msg)

log_info(msg)

log_warning(msg)

log_error(msg, stop = TRUE)

Arguments

bool

Boolean. If false - perform the logging

msg

String. Message to log

pfx

Int. Prefix to use in log-output. Only used internally

retcode

Int. Return code when 'bool' is not met. Only used internally

threshold

Int. Threshold to compare against the current logleve. Only used internally

stop

Bool. Results in a call to 'stop()' if condition is met for 'handle_error'. Result in 'stop()' for 'log_error'

Functions


lindberg-m/contextendR documentation built on Jan. 8, 2022, 3:16 a.m.