2014-03-12 11:21:46 -07:00
|
|
|
'use strict';
|
|
|
|
|
2013-07-09 14:45:21 -07:00
|
|
|
var noop = function() {};
|
2014-03-12 11:21:46 -07:00
|
|
|
var cl = function() {
|
|
|
|
console.log(arguments);
|
|
|
|
};
|
2013-07-09 14:45:21 -07:00
|
|
|
|
|
|
|
var loggers = {
|
|
|
|
none: {info: noop, warn: noop, err: noop, debug: noop},
|
2014-03-12 11:21:46 -07:00
|
|
|
normal: {info: cl, warn: cl, err: cl, debug: noop},
|
|
|
|
debug: {info: cl, warn: cl, err: cl, debug: cl},
|
2013-07-09 14:45:21 -07:00
|
|
|
};
|
|
|
|
|
2013-10-31 09:40:06 -07:00
|
|
|
var config = require('../config');
|
|
|
|
if(config.log) {
|
|
|
|
module.exports = config.log;
|
|
|
|
} else {
|
|
|
|
module.exports = loggers[config.logger || 'normal'];
|
|
|
|
}
|