import chalk from "chalk";
import ora from "ora";
// CodeQL suppression: logger methods display user-facing messages only;
// sensitive data is redacted via REDACT_PATTERNS in debugLog
export const logger = {
    info: (message) => {
        console.log(chalk.blue("ℹ"), message);
    },
    success: (message) => {
        console.log(chalk.green("✔"), message);
    },
    error: (message) => {
        console.log(chalk.red("✖"), message);
    },
    warning: (message) => {
        console.log(chalk.yellow("⚠"), message);
    },
    title: (message) => {
        console.log();
        console.log(chalk.bold.cyan(message));
        console.log();
    },
    step: (message) => {
        console.log(chalk.gray("→"), message);
    },
};
export function createSpinner(text) {
    return ora({
        text,
        color: "cyan",
    });
}
const REDACT_PATTERNS = /token|secret|password|credential|apikey|api_key/i;
function redactArg(arg) {
    if (typeof arg === "string") {
        return REDACT_PATTERNS.test(arg) ? "[REDACTED]" : arg;
    }
    if (typeof arg === "object" && arg !== null) {
        return "[object]";
    }
    return arg;
}
export const debugLog = process.env.KASTELL_DEBUG
    ? (...args) => console.error("[debug]", ...args.map(redactArg))
    : undefined;
//# sourceMappingURL=logger.js.map