Skip to content

Instantly share code, notes, and snippets.

@mandric
Created February 13, 2012 23:04
Show Gist options
  • Save mandric/1821310 to your computer and use it in GitHub Desktop.
Save mandric/1821310 to your computer and use it in GitHub Desktop.
var jsDump = require('jsDump'),
settings = require('settings/root');
var logger = exports.logger = {
levels: {silent:0, error:1, info:2, debug:2},
log: function(obj) {
if (typeof log !== 'undefined')
log(jsDump.parse(obj));
if (typeof console !== 'undefined')
console.log(obj);
},
info: function (obj) {
if (this.levels[settings.loglevel] >== this.levels['info']) {
this.log(obj);
}
},
debug: function (obj) {
if (this.levels[settings.loglevel] >== this.levels['debug']) {
this.log(obj);
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment