42 lines
2.8 KiB
JavaScript
42 lines
2.8 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
require("typings-global");
|
|
const beautylog_classes_ora_1 = require("./beautylog.classes.ora");
|
|
let nativeLog = console.log;
|
|
let nativeError = console.error;
|
|
/**
|
|
* routes the console to got through beautylog, so beautylog can take action before things are logged to console.
|
|
*/
|
|
let route = function (statusArg) {
|
|
if (statusArg === true) {
|
|
console.log = exports.beautyConsole.log;
|
|
console.error = exports.beautyConsole.error;
|
|
}
|
|
else {
|
|
console.log = nativeLog;
|
|
}
|
|
};
|
|
exports.beautyConsole = {
|
|
log: function (logArg) {
|
|
if (beautylog_classes_ora_1.oraActive) {
|
|
beautylog_classes_ora_1.activeOra.pause();
|
|
nativeLog.apply(nativeLog, arguments);
|
|
beautylog_classes_ora_1.activeOra.start();
|
|
}
|
|
else {
|
|
nativeLog.apply(nativeLog, arguments);
|
|
}
|
|
},
|
|
error: function () {
|
|
if (beautylog_classes_ora_1.oraActive) {
|
|
beautylog_classes_ora_1.activeOra.pause();
|
|
nativeLog.apply(nativeError, arguments);
|
|
beautylog_classes_ora_1.activeOra.start();
|
|
}
|
|
else {
|
|
nativeLog.apply(nativeError, arguments);
|
|
}
|
|
}
|
|
};
|
|
route(true);
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmVhdXR5bG9nLmNvbnNvbGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9iZWF1dHlsb2cuY29uc29sZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDBCQUF3QjtBQUV4QixtRUFBK0Q7QUFDL0QsSUFBSSxTQUFTLEdBQUcsT0FBTyxDQUFDLEdBQUcsQ0FBQztBQUM1QixJQUFJLFdBQVcsR0FBRyxPQUFPLENBQUMsS0FBSyxDQUFDO0FBRWhDOztHQUVHO0FBQ0gsSUFBSSxLQUFLLEdBQU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