import chalk from 'chalk';
import { appendFileSync } from 'node:fs';
import { join } from 'node:path';
import ora from 'ora';
export class CliLoggerAdapter {
    logFilePath = join(process.cwd(), 'aurora-deploy.log');
    error(message) {
        console.log(chalk.red('\u2716'), message);
    }
    header(title) {
        console.log('');
        console.log(chalk.bold.cyan(`\u2501\u2501\u2501 ${title} \u2501\u2501\u2501`));
        console.log('');
    }
    info(message) {
        console.log(chalk.blue('\u2139'), message);
    }
    logError(context, error) {
        const timestamp = new Date().toISOString();
        const detail = error instanceof Error
            ? `${error.message}\n${error.stack ?? ''}`
            : String(error);
        appendFileSync(this.logFilePath, `[${timestamp}] ${context}\n${detail}\n\n`, 'utf8');
        console.log(chalk.dim(`  Revisa ${this.logFilePath} para más detalles.`));
    }
    step(label) {
        return ora(label).start();
    }
    success(message) {
        console.log(chalk.green('\u2714'), message);
    }
    warn(message) {
        console.log(chalk.yellow('\u26A0'), message);
    }
}
