UNPKG

l2en-cli

Version:

cli,项目脚手架,快速搭建项目框架

68 lines 1.64 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LogType = void 0; var chalk_1 = require("chalk"); var LogType; (function (LogType) { LogType["info"] = "info"; LogType["error"] = "error"; LogType["success"] = "success"; LogType["trace"] = "trace"; LogType["debug"] = "debug"; LogType["warn"] = "warn"; LogType["fatal"] = "fatal"; LogType["order"] = "order"; })(LogType = exports.LogType || (exports.LogType = {})); var logTypeList = [ { 'type': LogType.info, 'color': 'cyan', 'icon': '>' }, { 'type': LogType.error, 'color': 'red', 'icon': '' }, { 'type': LogType.success, 'color': 'green', 'icon': '√' }, { 'type': LogType.trace, 'color': 'dim', 'icon': '*' }, { 'type': LogType.debug, 'color': 'bgBlack', 'icon': '*' }, { 'type': LogType.warn, 'color': 'yellow', 'icon': '!' }, { 'type': LogType.fatal, 'color': 'bgRed', 'icon': '×' }, { 'type': LogType.order, 'color': 'green', 'icon': '$' } ]; var logMapFunction = {}; logTypeList.forEach(function (logType) { logMapFunction[logType.type] = function () { var args = Array.prototype.slice.call(arguments, 0); if (logType.icon) args = [logType.icon].concat(args); global.console.log(chalk_1.default[logType.color].apply(global.console, args)); }; }); exports.default = logMapFunction; //# sourceMappingURL=log.js.map