colorize_levels: Colorize Levels

Description Usage Arguments Value See Also Examples

View source: R/log_levels.R

Description

Colorize Levels

Usage

1
colorize_levels(x, colors = getOption("lgr.colors", NULL))

Arguments

x

numeric or character levels to be colored. Unlike in many other functions in lgr, character levels are not case sensitive in this function and leading/trailing whitespace is ignored to make it more comfortable to use colorize_levels() inside formatting functions.

colors

A list of functions that will be used to color the log levels (likely from crayon::crayon).

Value

a character vector wit color ANSI codes

See Also

Other formatting utils: label_levels

Examples

1
2
cat(colorize_levels(c(100, 200)))
cat(colorize_levels(c("trace", "warn ", "DEBUG")))

s-fleck/yog documentation built on Jan. 17, 2019, 5:56 a.m.