diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2016-08-12 04:59:14 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2016-08-12 04:59:14 +0800 |
commit | 9904b4ef5a3d942c97e0585a9f1e4a5ddc7de8e6 (patch) | |
tree | ad4cdf64e43d0804a735470050794ff5a793ca97 /app/scripts/metamask-controller.js | |
parent | ffb48028a35e68bf53041cf34e75e7b9acf87aa2 (diff) | |
download | tangerine-wallet-browser-9904b4ef5a3d942c97e0585a9f1e4a5ddc7de8e6.tar tangerine-wallet-browser-9904b4ef5a3d942c97e0585a9f1e4a5ddc7de8e6.tar.gz tangerine-wallet-browser-9904b4ef5a3d942c97e0585a9f1e4a5ddc7de8e6.tar.bz2 tangerine-wallet-browser-9904b4ef5a3d942c97e0585a9f1e4a5ddc7de8e6.tar.lz tangerine-wallet-browser-9904b4ef5a3d942c97e0585a9f1e4a5ddc7de8e6.tar.xz tangerine-wallet-browser-9904b4ef5a3d942c97e0585a9f1e4a5ddc7de8e6.tar.zst tangerine-wallet-browser-9904b4ef5a3d942c97e0585a9f1e4a5ddc7de8e6.zip |
Add ability to hide logging messages in production.
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r-- | app/scripts/metamask-controller.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index dd43ac2fc..a5c167223 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -7,6 +7,7 @@ const HostStore = require('./lib/remote-store.js').HostStore const Web3 = require('web3') const ConfigManager = require('./lib/config-manager') const extension = require('./lib/extension') +const developmentMode = require('./config').developmentMode module.exports = class MetamaskController { @@ -93,7 +94,7 @@ module.exports = class MetamaskController { function logger (err, request, response) { if (err) return console.error(err) - if (!request.isMetamaskInternal) { + if (developmentMode && !request.isMetamaskInternal) { console.log(`RPC (${originDomain}):`, request, '->', response) if (response.error) { console.error('Error in RPC response:\n', response.error) @@ -218,7 +219,9 @@ module.exports = class MetamaskController { // Log blocks processBlock (block) { - console.log(`BLOCK CHANGED: #${block.number.toString('hex')} 0x${block.hash.toString('hex')}`) + if (developmentMode) { + console.log(`BLOCK CHANGED: #${block.number.toString('hex')} 0x${block.hash.toString('hex')}`) + } this.verifyNetwork() } |