2016-05-19 17:27:09 +00:00
|
|
|
"use strict";
|
2017-03-11 11:30:18 +00:00
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
2016-05-23 07:10:30 +00:00
|
|
|
require("typings-global");
|
2016-07-23 17:47:23 +00:00
|
|
|
const beautylog_classes_ora_1 = require("./beautylog.classes.ora");
|
|
|
|
let nativeLog = console.log;
|
|
|
|
let nativeError = console.error;
|
2016-05-19 17:27:09 +00:00
|
|
|
/**
|
|
|
|
* routes the console to got through beautylog, so beautylog can take action before things are logged to console.
|
|
|
|
*/
|
2016-07-23 17:47:23 +00:00
|
|
|
let route = function (statusArg) {
|
2017-01-21 00:05:28 +00:00
|
|
|
if (statusArg === true) {
|
2016-05-19 17:27:09 +00:00
|
|
|
console.log = exports.beautyConsole.log;
|
2016-07-23 17:47:23 +00:00
|
|
|
console.error = exports.beautyConsole.error;
|
2016-05-19 17:27:09 +00:00
|
|
|
}
|
|
|
|
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);
|
|
|
|
}
|
2016-07-23 17:47:23 +00:00
|
|
|
},
|
|
|
|
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);
|
|
|
|
}
|
2016-05-19 17:27:09 +00:00
|
|
|
}
|
|
|
|
};
|
2016-05-19 17:45:31 +00:00
|
|
|
route(true);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