113 lines
14 KiB
JavaScript
113 lines
14 KiB
JavaScript
/// <reference path="./typings/main.d.ts" />
|
|
"use strict";
|
|
var plugins = require("./beautylog.plugins");
|
|
var beautylog_classes_ora_1 = require("./beautylog.classes.ora");
|
|
var localBl = {
|
|
dirPrefix: plugins.clc.bgXterm(39).xterm(231).bold(' DIR ') + ' ',
|
|
errorPrefix: ' Error: '.bgRed.white.bold + ' ',
|
|
infoPrefix: plugins.clc.bgXterm(198).xterm(231).bold(' INFO ') + ' ',
|
|
normalPrefix: ' Log: '.bgCyan.white.bold + ' ',
|
|
okPrefix: ' '.bgGreen + ' OK! '.bgBlack.green.bold + ' ',
|
|
successPrefix: ' Success: '.bgGreen.white.bold + ' ',
|
|
warnPrefix: ' '.bgYellow + ' Warn: '.bgBlack.yellow.bold + ' '
|
|
};
|
|
/**
|
|
*
|
|
* @param logText
|
|
* @param logType
|
|
* @returns {boolean}
|
|
*/
|
|
exports.log = function (logText, logType) {
|
|
if (logText === void 0) { logText = 'empty log'; }
|
|
if (logType === void 0) { logType = 'normal'; }
|
|
switch (plugins.smartenv.getEnv().runtimeEnv) {
|
|
case "node":
|
|
if (beautylog_classes_ora_1.isOraActive) {
|
|
beautylog_classes_ora_1.activeOra.log(logText, logType);
|
|
}
|
|
else {
|
|
exports.logNode(logText, logType);
|
|
}
|
|
break;
|
|
case "browser":
|
|
logBrowser(logText, logType);
|
|
break;
|
|
default:
|
|
console.log("something is strange about the platform in which you try to use beautylog");
|
|
break;
|
|
}
|
|
};
|
|
exports.logNode = function (logText, logType) {
|
|
try {
|
|
switch (logType) {
|
|
case 'dir':
|
|
logText = localBl.dirPrefix + plugins.clc.xterm(26)(logText);
|
|
break;
|
|
case 'error':
|
|
logText = localBl.errorPrefix + logText.red.bold;
|
|
break;
|
|
case 'info':
|
|
logText = localBl.infoPrefix + plugins.clc.xterm(198)(logText);
|
|
break;
|
|
case 'normal':
|
|
logText = localBl.normalPrefix + logText.cyan.bold;
|
|
break;
|
|
case 'ok':
|
|
logText = localBl.okPrefix + logText.bold;
|
|
break;
|
|
case 'success':
|
|
logText = localBl.successPrefix + logText.green.bold;
|
|
break;
|
|
case 'warn':
|
|
logText = localBl.warnPrefix + logText.bold;
|
|
break;
|
|
case 'log':
|
|
logText = localBl.normalPrefix + logText.blue.bold;
|
|
break;
|
|
default:
|
|
logText.blue.bold;
|
|
console.log(('unknown logType for "' + logText + '"').red.bold);
|
|
break;
|
|
}
|
|
console.log(logText);
|
|
return true;
|
|
}
|
|
catch (error) {
|
|
console.log(localBl.errorPrefix + 'You seem to have tried logging something strange'.red.bold + error);
|
|
return false;
|
|
}
|
|
};
|
|
var logBrowser = function (logText, logType) {
|
|
switch (logType) {
|
|
case 'dir':
|
|
logText = localBl.dirPrefix + plugins.clc.xterm(26)(logText);
|
|
break;
|
|
case 'error':
|
|
logText = localBl.errorPrefix + logText.red.bold;
|
|
break;
|
|
case 'info':
|
|
console.log('%c Info: %c ' + logText, 'background:#EC407A;color:#ffffff;', 'color:#EC407A;');
|
|
break;
|
|
case 'normal':
|
|
logText = localBl.normalPrefix + logText.cyan.bold;
|
|
break;
|
|
case 'ok':
|
|
console.log('%c OK: %c ' + logText, "background:#000000;color:#8BC34A;", "color:#000000;");
|
|
break;
|
|
case 'success':
|
|
console.log('%c Success: %c ' + logText, "background:#8BC34A;color:#ffffff;", "color:#8BC34A;");
|
|
break;
|
|
case 'warn':
|
|
console.log('%c Warn: %c ' + logText, "background:#000000;color:#FB8C00;", "color:#000000;");
|
|
break;
|
|
case 'log':
|
|
console.log('%c Log: %c ' + logText, "background:#42A5F5;color:#ffffff", "color:#42A5F5;");
|
|
break;
|
|
default:
|
|
console.log('unknown logType for "' + logText + '"');
|
|
break;
|
|
}
|
|
};
|
|
|
|
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5sb2cuaGVscGVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF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sZDtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlICdvayc6XHJcbiAgICAgICAgICAgICAgICBsb2dUZXh0ID0gbG9jYWxCbC5va1ByZWZpeCArIGxvZ1RleHQuYm9sZDtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlICdzdWNjZXNzJzpcclxuICAgICAgICAgICAgICAgIGxvZ1RleHQgPSBsb2NhbEJsLnN1Y2Nlc3NQcmVmaXggKyBsb2dUZXh0LmdyZWVuLmJvbGQ7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSAnd2Fybic6XHJcbiAgICAgICAgICAgICAgICBsb2dUZXh0ID0gbG9jYWxCbC53YXJuUHJlZml4ICsgbG9nVGV4dC5ib2xkO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgJ2xvZyc6XHJcbiAgICAgICAgICAgICAgICBsb2dUZXh0ID0gbG9jYWxCbC5ub3JtYWxQcmVmaXggKyBsb2dUZXh0LmJsdWUuYm9sZDtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBkZWZhdWx0OlxyXG4gICAgICAgICAgICAgICAgbG9nVGV4dC5ibHVlLmJvbGQ7XHJcbiAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygoJ3Vua25vd24gbG9nVHlwZSBmb3IgXCInICsgbG9nVGV4dCArICdcIicpLnJlZC5ib2xkKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIH1cclxuICAgICAgICBjb25zb2xlLmxvZyhsb2dUZXh0KTtcclxuICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgIH1cclxuICAgIGNhdGNoIChlcnJvcikge1xyXG4gICAgICAgIGNvbnNvbGUubG9nKGxvY2FsQmwuZXJyb3JQcmVmaXggKyAnWW91IHNlZW0gdG8gaGF2ZSB0cmllZCBsb2dnaW5nIHNvbWV0aGluZyBzdHJhbmdlJy5yZWQuYm9sZCArIGVycm9yKTtcclxuICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICB9XHJcbn1cclxuXHJcbmxldCBsb2dCcm93c2VyID0gZnVuY3Rpb24obG9nVGV4dCxsb2dUeXBlKXtcclxuICAgIHN3aXRjaCAobG9nVHlwZSkge1xyXG4gICAgICAgICAgICBjYXNlICdkaXInOlxyXG4gICAgICAgICAgICAgICAgbG9nVGV4dCA9IGxvY2FsQmwuZGlyUHJlZml4ICsgcGx1Z2lucy5jbGMueHRlcm0oMjYpKGxvZ1RleHQpO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgJ2Vycm9yJzpcclxuICAgICAgICAgICAgICAgIGxvZ1RleHQgPSBsb2NhbEJsLmVycm9yUHJlZml4ICsgbG9nVGV4dC5yZWQuYm9sZDtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlICdpbmZvJzpcclxuICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCclYyBJbmZvOiAlYyAnICsgbG9nVGV4dCwnYmFja2dyb3VuZDojRUM0MDdBO2NvbG9yOiNmZmZmZmY7JywnY29sb3I6I0VDNDA3QTsnKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlICdub3JtYWwnOlxyXG4gICAgICAgICAgICAgICAgbG9nVGV4dCA9IGxvY2FsQmwubm9ybWFsUHJlZml4ICsgbG9nVGV4dC5jeWFuLmJvbGQ7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSAnb2snOlxyXG4gICAgICAgICAgICAgICAgY29uc29sZS5sb2coJyVjIE9LOiAlYyAnICsgbG9nVGV4dCxcImJhY2tncm91bmQ6IzAwMDAwMDtjb2xvcjojOEJDMzRBO1wiLFwiY29sb3I6IzAwMDAwMDtcIik7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSAnc3VjY2Vzcyc6XHJcbiAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygnJWMgU3VjY2VzczogJWMgJyArIGxvZ1RleHQsXCJiYWNrZ3JvdW5kOiM4QkMzNEE7Y29sb3I6I2ZmZmZmZjtcIixcImNvbG9yOiM4QkMzNEE7XCIpO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgJ3dhcm4nOlxyXG4gICAgICAgICAgICAgICAgY29uc29sZS5sb2coJyVjIFdhcm46ICVjICcgKyBsb2dUZXh0LFwiYmFja2dyb3VuZDojMDAwMDAwO2NvbG9yOiNGQjhDMDA7XCIsXCJjb2xvcjojMDAwMDAwO1wiKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlICdsb2cnOlxyXG4gICAgICAgICAgICAgICAgY29uc29sZS5sb2coJyVjIExvZzogJWMgJyArIGxvZ1RleHQsXCJiYWNrZ3JvdW5kOiM0MkE1RjU7Y29sb3I6I2ZmZmZmZlwiLFwiY29sb3I6IzQyQTVGNTtcIik7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgZGVmYXVsdDpcclxuICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCd1bmtub3duIGxvZ1R5cGUgZm9yIFwiJyArIGxvZ1RleHQgKyAnXCInKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIH1cclxufTsiXX0=
|