/**
 * CLI logger wrapping `Logger` with semantic output methods.
 *
 * Why wrapper, not subclass: Logger has variadic `...args` methods, CLI adds
 * single-string semantic methods. Mixing calling conventions on one class is confusing.
 * Composition keeps both APIs clean.
 *
 * Why Logger prefixes for error/warn: Unifies error/warn visual style across CLI
 * and backend. CLI-specific methods (success/skip/step/header) add their own semantic
 * prefixes via `logger.info()`.
 *
 * @module
 */
import { Logger } from '@fuzdev/fuz_util/log.js';
/**
 * Creates a CLI logger wrapping a Logger with semantic output methods.
 *
 * @param logger - the Logger instance to wrap
 * @returns a `CliLogger` with CLI semantic methods mapped to Logger levels
 */
export const create_cli_logger = (logger) => ({
    error: (...args) => logger.error(...args),
    warn: (...args) => logger.warn(...args),
    info: (...args) => logger.info(...args),
    debug: (...args) => logger.debug(...args),
    raw: (...args) => logger.raw(...args),
    success: (msg) => {
        const c = logger.colors;
        logger.info(c ? `\x1b[32m[done]\x1b[0m ${msg}` : `[done] ${msg}`);
    },
    skip: (msg) => {
        const c = logger.colors;
        logger.info(c ? `\x1b[33m[skip]\x1b[0m ${msg}` : `[skip] ${msg}`);
    },
    step: (msg) => {
        const c = logger.colors;
        logger.info(c ? `\n\x1b[36m==>\x1b[0m ${msg}` : `\n==> ${msg}`);
    },
    header: (title) => {
        const c = logger.colors;
        logger.info(c ? `\n\x1b[33m=== ${title} ===\x1b[0m\n` : `\n=== ${title} ===\n`);
    },
    dim: (msg) => {
        const c = logger.colors;
        logger.info(c ? `\x1b[2m${msg}\x1b[0m` : msg);
    },
    logger,
});
