UNPKG

791 BJavaScriptView Raw
1(function (window) {
2 'use strict';
3
4 function Logger(enableDebug) {
5 this.debugEnabled = enableDebug || false;
6 }
7
8 Logger.prototype.info = function () {
9 if (this.debugEnabled) {
10 var args = Array.prototype.slice.call(arguments);
11 console.info.apply(console, args);
12 }
13 };
14
15 Logger.prototype.debug = function () {
16 if (this.debugEnabled) {
17 var args = Array.prototype.slice.call(arguments);
18 console.debug.apply(console, args);
19 }
20 };
21
22 Logger.prototype.error = function () {
23 if (this.debugEnabled) {
24 var args = Array.prototype.slice.call(arguments);
25 console.error.apply(console, args);
26 }
27 };
28
29 window.StatfulLogger = Logger;
30
31})(window);
32