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 = {
|
2014-06-23 10:57:02 -07:00
|
|
|
none: {
|
|
|
|
info: noop,
|
|
|
|
warn: noop,
|
|
|
|
err: noop,
|
|
|
|
debug: noop
|
|
|
|
},
|
|
|
|
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');
|
2014-06-23 10:57:02 -07:00
|
|
|
if (config.log) {
|
2013-10-31 09:40:06 -07:00
|
|
|
module.exports = config.log;
|
|
|
|
} else {
|
|
|
|
module.exports = loggers[config.logger || 'normal'];
|
|
|
|
}
|