import { cyan, red, yellow, green, dim, bold } from 'colorette';
import consolaGlobalInstance from 'consola';
const logMethodColorMap = {
    info: cyan,
    error: (message) => bold(red(message)),
    warn: (message) => bold(yellow(message)),
    debug: dim,
    verbose: dim,
    success: green,
};
const withColor = (logger) => (method, message) => logger(logMethodColorMap[method](message));
export default function log(method, message) {
    switch (method) {
        case 'error':
            withColor(consolaGlobalInstance.error)(method, message);
            break;
        case 'info':
            withColor(consolaGlobalInstance.info)(method, message);
            break;
        case 'warn':
            withColor(consolaGlobalInstance.warn)(method, message);
            break;
        default:
            withColor(consolaGlobalInstance.log)(method, message);
    }
    return;
}
