% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/log_levels.R
\name{colorize_levels}
\alias{colorize_levels}
\title{Colorize Levels}
\usage{
colorize_levels(
  x,
  colors = getOption("lgr.colors", NULL),
  transform = identity
)
}
\arguments{
\item{x}{\code{numeric} or \code{character} levels to be colored. Unlike in many other
functions in lgr, \code{character} levels are \emph{not} case sensitive in this
function and leading/trailing whitespace is ignored to make it more
comfortable to use \code{colorize_levels()} inside formatting functions.}

\item{colors}{A \code{list} of \code{functions} that will be used to color the
log levels (likely from \link[crayon:crayon]{crayon::crayon}).}

\item{transform}{a \code{function} to transform \code{x} (for example \code{toupper()})}
}
\value{
a \code{character} vector wit color ANSI codes
}
\description{
Colorize Levels
}
\examples{
cat(colorize_levels(c(100, 200)))
cat(colorize_levels(c("trace", "warn ", "DEBUG")))
cat(colorize_levels(c("trace", "warn ", "DEBUG"), transform = function(x) strtrim(x, 1) ))
}
\seealso{
Other formatting utils: 
\code{\link{label_levels}()}
}
\concept{formatting utils}
