docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a simple CLI logger that displays messages with different visual intensities based on alert levels. The logger should use high-visibility colors for critical alerts and standard colors for normal messages.
Your logger should support four alert levels with different visual treatments:
Each alert level should be displayed with a distinct color. Critical, warning, and success messages should use high-visibility color variants, while info messages should use standard color intensity.
Create a module that exports a log function:
/**
* Logs a message with appropriate visual styling based on alert level.
*
* @param {string} level - The alert level: 'CRITICAL', 'WARNING', 'SUCCESS', or 'INFO'
* @param {string} message - The message to display
* @returns {string} The formatted message with color codes
*/
function log(level, message) {
// IMPLEMENTATION HERE
}
module.exports = { log };Provides terminal color formatting support.