fix function call issue

This commit is contained in:
Philipp Kunz 2016-05-19 19:45:31 +02:00
parent 38684f2a88
commit 86d8816ebc
5 changed files with 10 additions and 11 deletions

View File

@ -1,7 +1,3 @@
/**
* routes the console to got through beautylog, so beautylog can take action before things are logged to console.
*/
export declare let route: (statusArg: boolean) => void;
export declare let beautyConsole: {
log2: (message?: any, ...optionalParams: any[]) => void;
log: (logArg: any) => void;

View File

@ -4,7 +4,7 @@ var nativeLog = console.log;
/**
* routes the console to got through beautylog, so beautylog can take action before things are logged to console.
*/
exports.route = function (statusArg) {
var route = function (statusArg) {
if (statusArg == true) {
console.log = exports.beautyConsole.log;
}
@ -25,5 +25,6 @@ exports.beautyConsole = {
}
}
};
route(true);
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5jb25zb2xlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFFQSxzQ0FBa0MseUJBQXlCLENBQUMsQ0FBQTtBQUM1RCxJQUFJLFNBQVMsR0FBRyxPQUFPLENBQUMsR0FBRyxDQUFDO0FBRTVCOztHQUVHO0FBQ1EsYUFBSyxHQUFHLFVBQVMsU0FBaUI7SUFDekMsRUFBRSxDQUFBLENBQUMsU0FBUyxJQUFJLElBQUksQ0FBQyxDQUFBLENBQUM7UUFDbEIsT0FBTyxDQUFDLEdBQUcsR0FBRyxxQkFBYSxDQUFDLEdBQUcsQ0FBQztJQUNwQyxDQUFDO0lBQUMsSUFBSSxDQUFDLENBQUM7UUFDSixPQUFPLENBQUMsR0FBRyxHQUFHLFNBQVMsQ0FBQztJQUM1QixDQUFDO0FBRUwsQ0FBQyxDQUFBO0FBRVUscUJBQWEsR0FBRztJQUN2QixJQUFJLEVBQUUsU0FBUztJQUNmLEdBQUcsRUFBRSxVQUFTLE1BQVU7UUFDcEIsRUFBRSxDQUFBLENBQUMsaUNBQVMsQ0FBQyxDQUFBLENBQUM7WUFDVixpQ0FB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gICB9IGVsc2Uge1xyXG4gICAgICAgIGNvbnNvbGUubG9nID0gbmF0aXZlTG9nO1xyXG4gICAgfVxyXG4gICAgXHJcbn07XHJcblxyXG5leHBvcnQgbGV0IGJlYXV0eUNvbnNvbGUgPSB7XHJcbiAgICBsb2cyOiBuYXRpdmVMb2csXHJcbiAgICBsb2c6IGZ1bmN0aW9uKGxvZ0FyZzphbnkpe1xyXG4gICAgICAgIGlmKG9yYUFjdGl2ZSl7XHJcbiAgICAgICAgICAgIGFjdGl2ZU9yYS5wYXVzZSgpO1xyXG4gICAgICAgICAgICBuYXRpdmVMb2cuYXBwbHkobmF0aXZlTG9nLCBhcmd1bWVudHMpO1xyXG4gICAgICAgICAgICBhY3RpdmVPcmEuc3RhcnQoKTtcclxuICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICBuYXRpdmVMb2cuYXBwbHkobmF0aXZlTG9nLCBhcmd1bWVudHMpO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxufVxyXG5cclxucm91dGUodHJ1ZSk7Il19

2
dist/index.js vendored
View File

@ -16,4 +16,4 @@ exports.ok = BeautylogLog.ok;
exports.success = BeautylogLog.success;
exports.warn = BeautylogLog.warn;
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0Qzs7QUFHNUMsSUFBWSxZQUFZLFdBQU0saUJBQWlCLENBQUMsQ0FBQTtBQUNoRCxJQUFZLGVBQWUsV0FBTSxvQkFDakMsQ0FBQyxDQURvRDtBQUdyRCx3Q0FBb0IsMkJBQTJCLENBQUM7QUFBeEMsZ0RBQXdDO0FBQ2hELHNDQUFrQix5QkFBeUIsQ0FBQztBQUFwQywwQ0FBb0M7QUFFakMsV0FBRyxHQUFJLFlBQVksQ0FBQyxHQUFHLENBQUM7QUFDeEIsYUFBSyxHQUFJLFlBQVksQ0FBQy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9nLmxvZztcclxuZXhwb3J0IGxldCBvayA9ICBCZWF1dHlsb2dMb2cub2s7XHJcbmV4cG9ydCBsZXQgc3VjY2VzcyA9ICBCZWF1dHlsb2dMb2cuc3VjY2VzcztcclxuZXhwb3J0IGxldCB3YXJuID0gIEJlYXV0eWxvZ0xvZy53YXJuOyJdfQ==

View File

@ -6,14 +6,14 @@ let nativeLog = console.log;
/**
* routes the console to got through beautylog, so beautylog can take action before things are logged to console.
*/
export let route = function(statusArg:boolean){
let route = function(statusArg:boolean){
if(statusArg == true){
console.log = beautyConsole.log;
} else {
console.log = nativeLog;
}
}
};
export let beautyConsole = {
log2: nativeLog,
@ -26,4 +26,6 @@ export let beautyConsole = {
nativeLog.apply(nativeLog, arguments);
}
}
}
}
route(true);

View File

@ -16,4 +16,4 @@ export let info = BeautylogLog.info;
export let log = BeautylogLog.log;
export let ok = BeautylogLog.ok;
export let success = BeautylogLog.success;
export let warn = BeautylogLog.warn;
export let warn = BeautylogLog.warn;