Skip to content

Commit

Permalink
new change
Browse files Browse the repository at this point in the history
  • Loading branch information
tfs-chetan-das committed Aug 14, 2015
1 parent 4d91c77 commit 7e63a3f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/wrapper/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ var connect_logger = require('connect').logger;
var process = require('process');

var logTypes = {INFO:'INFO',ERROR:'ERROR', WARN:'WARN', ALERT:'ALERT', DEBUG:'DEBUG'};
var debug_flag = false;
if (process.env.LOG_LEVEL == "DEBUG")
debug_flag = true;

var Logger = function(options) {
var instance = this;
Expand Down Expand Up @@ -96,8 +99,12 @@ Logger.prototype.warn = function(module, message){
}

Logger.prototype.debug = function(module, message){
var instance = this;
instance.log(module, logTypes['DEBUG'], message);
if(debug_flag) {
var instance = this;
instance.log(module, logTypes['DEBUG'], message);
} else {
// do nothing
}
}

Logger.prototype.accessLog = function(){
Expand Down

0 comments on commit 7e63a3f

Please sign in to comment.