diff --git a/README.md b/README.md index a470313..c949c88 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,8 @@ INSIGHT_NETWORK [= 'livenet' | 'testnet'] INSIGHT_DB # Path where to store insight's internal DB. (defaults to $HOME/.insight) INSIGHT_SAFE_CONFIRMATIONS=6 # Nr. of confirmation needed to start caching transaction information INSIGHT_IGNORE_CACHE # True to ignore cache of spents in transaction, with more than INSIGHT_SAFE_CONFIRMATIONS confirmations. This is useful for tracking double spents for old transactions. -ENABLE_MAILBOX # if "true" will enable message broker module +ENABLE_MAILBOX # if "true" will enable mailbox plugin +LOGGER_LEVEL # defaults to 'info', can be 'debug','verbose','error', etc. ``` diff --git a/config/config.js b/config/config.js index ca1fe4c..f3941ac 100644 --- a/config/config.js +++ b/config/config.js @@ -77,6 +77,7 @@ var bitcoindConf = { }; var enableMailbox = process.env.ENABLE_MAILBOX === 'true'; +var loggerLevel = process.env.LOGGER_LEVEL || 'info'; if (!fs.existsSync(db)) { var err = fs.mkdirSync(db); @@ -90,6 +91,7 @@ if (!fs.existsSync(db)) { module.exports = { enableMailbox: enableMailbox, + loggerLevel: loggerLevel, version: version, root: rootPath, publicPath: process.env.INSIGHT_PUBLIC_PATH || false, diff --git a/lib/logger.js b/lib/logger.js index 61140ee..2884ec7 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -1,4 +1,5 @@ var winston = require('winston'); +var config = require('../config/config'); var logger = new winston.Logger({ transports: [ @@ -7,7 +8,7 @@ var logger = new winston.Logger({ }), ] }); -logger.transports.console.level = 'debug'; +logger.transports.console.level = config.loggerLevel; logger.info('starting...'); module.exports.logger = logger; diff --git a/plugins/mailbox.js b/plugins/mailbox.js index 5d6cab7..75cfdb9 100644 --- a/plugins/mailbox.js +++ b/plugins/mailbox.js @@ -8,7 +8,6 @@ module.exports.init = function(ext_io, config) { preconditions.checkArgument(ext_io); io = ext_io; io.sockets.on('connection', function(socket) { - // when it requests sync, send him all pending messages // when it requests sync, send him all pending messages socket.on('sync', function(ts) { logger.debug('Sync requested by ' + socket.id);