bitcore-lib-zcash/util/log.js

35 lines
486 B
JavaScript
Raw Normal View History

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
},
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
};
var config = require('../config');
if (config.log) {
module.exports = config.log;
} else {
module.exports = loggers[config.logger || 'normal'];
}