Documents / @faasjs/node-utils / colorize
Function: colorize()
colorize(
level,message):string
Wrap a log message with the ANSI foreground color for a log level.
This low-level helper always emits ANSI escape sequences; use Logger when you want environment-aware color decisions.
Parameters
level
Log level used to select the foreground color.
message
string
Plain text message to colorize.
Returns
string
Message wrapped in ANSI color escape sequences.
Example
import { colorize } from '@faasjs/node-utils'
console.log(colorize('warn', 'Low disk space'))