UNPKG

pabala-biu

Version:

Changelogs

53 lines 1.39 kB
"use strict"; exports.__esModule = true; var log = {}; function typeColor(type) { if (type === void 0) { type = 'default'; } var color = ''; switch (type) { case 'primary': color = '#2d8cf0'; break; case 'success': color = '#19be6b'; break; case 'info': color = '#909399'; break; case 'warning': color = '#ff9900'; break; case 'danger': color = '#f03f14'; break; case 'default': color = '#35495E'; break; default: color = type; break; } return color; } log['print'] = function (text, type, back) { if (type === void 0) { type = 'default'; } if (back === void 0) { back = false; } if (typeof text === 'object') { console.dir(text); return; } if (back) { console.log("%c " + text + " ", "background:" + typeColor(type) + "; padding: 2px; border-radius: 4px;color: #fff;"); } else { console.log("%c " + text + " ", "color: " + typeColor(type) + ";"); } }; log.pretty = function (title, text, type) { if (type === void 0) { type = 'primary'; } console.log(title + " " + text + " "); }; log.error = function () { }; exports["default"] = log; //# sourceMappingURL=logprint.js.map