Skip to content

Commit

Permalink
logger debugEnabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Quickcorp committed May 9, 2018
1 parent 906715a commit da5e2bb
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions QCObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,25 @@
}
};
window.top.asyncLoad = asyncLoad;
var Logger = function() {};
var Logger = function() {return {
debugEnabled:true,
infoEnabled:true,
warnEnabled:true
}};
Logger.prototype.debug = function(message) {
console.log('[DEBUG] ' + message);
if (this.debugEnabled){
console.log('[DEBUG] ' + message);
}
};
Logger.prototype.info = function(message) {
console.log('[INFO] ' + message);
if (this.infoEnabled){
console.log('[INFO] ' + message);
}
};
Logger.prototype.warn = function(message) {
console.log('[WARN] ' + message);
if (this.warnEnabled){
console.log('[WARN] ' + message);
}
};
var logger = new Logger();
window.top.logger = logger;
Expand Down

0 comments on commit da5e2bb

Please sign in to comment.