logger (version 0.3.0)

grayscale_by_log_level: Render a string with light/dark gray based on the related log level

Description

Adding color to a string to be used in terminal output. Supports ANSI standard colors 8 or 256.

Usage

grayscale_by_log_level(msg, level)

Value

string with ANSI escape code

Arguments

msg

string

level

see log_levels

Examples

Run this code
if (FALSE) {
cat(grayscale_by_log_level(FATAL, 'foobar'), '\n')
cat(grayscale_by_log_level(ERROR, 'foobar'), '\n')
cat(grayscale_by_log_level(WARN, 'foobar'), '\n')
cat(grayscale_by_log_level(SUCCESS, 'foobar'), '\n')
cat(grayscale_by_log_level(INFO, 'foobar'), '\n')
cat(grayscale_by_log_level(DEBUG, 'foobar'), '\n')
cat(grayscale_by_log_level(TRACE, 'foobar'), '\n')
}

Run the code above in your browser using DataLab