"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.logger = exports.debug = exports.isDebug = void 0;
const chalk_1 = __importDefault(require("@modern-js/utils/chalk"));
const logger_1 = require("@modern-js/utils/logger");
Object.defineProperty(exports, "logger", { enumerable: true, get: function () { return logger_1.logger; } });
const isDebug = () => process.env.DEBUG === 'builder';
exports.isDebug = isDebug;
const debug = (message) => {
    if ((0, exports.isDebug)()) {
        const { performance } = require('perf_hooks');
        const result = typeof message === 'string' ? message : message();
        const time = chalk_1.default.gray(`[${performance.now().toFixed(2)} ms]`);
        console.error(`${chalk_1.default.yellow.bold('debug')}   ${result} ${time}`);
    }
};
exports.debug = debug;
