or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-3/

Configuration-Based Logger

A simple logging utility that supports configurable colored output based on user preferences. The logger should respect color settings and output formatted log messages at different severity levels.

Capabilities

Respects color configuration

  • When color is enabled in configuration, the logger outputs colored text @test
  • When color is disabled in configuration, the logger outputs plain text without ANSI codes @test

Supports multiple log levels

  • The logger has an error() method that outputs red text when colors are enabled @test
  • The logger has a success() method that outputs green text when colors are enabled @test
  • The logger has a warning() method that outputs yellow text when colors are enabled @test
  • The logger has an info() method that outputs cyan text when colors are enabled @test

Implementation

@generates

API

/**
 * Creates a logger instance with configurable color support.
 *
 * @param {Object} config - Configuration object
 * @param {boolean} config.colorEnabled - Whether to enable colored output
 * @returns {Object} Logger instance with error, success, warning, and info methods
 */
function createLogger(config) {
  // IMPLEMENTATION HERE
}

module.exports = { createLogger };

Dependencies { .dependencies }

picocolors { .dependency }

Provides terminal color formatting support.