colorize_by_log_level: Colorize string by the related log level

View source: R/color.R

colorize_by_log_levelR Documentation

Colorize string by the related log level

Description

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

Usage

colorize_by_log_level(msg, level)

Arguments

msg

string

level

see log_levels

Value

string with ANSI escape code

Examples

## Not run: 
cat(colorize_by_log_level(FATAL, 'foobar'), '\n')
cat(colorize_by_log_level(ERROR, 'foobar'), '\n')
cat(colorize_by_log_level(WARN, 'foobar'), '\n')
cat(colorize_by_log_level(SUCCESS, 'foobar'), '\n')
cat(colorize_by_log_level(INFO, 'foobar'), '\n')
cat(colorize_by_log_level(DEBUG, 'foobar'), '\n')
cat(colorize_by_log_level(TRACE, 'foobar'), '\n')

## End(Not run)

daroczig/logger documentation built on March 8, 2024, 6:49 p.m.