diff options
author | Kevin Serrano <kevin.serrano@consensys.net> | 2017-10-26 06:45:26 +0800 |
---|---|---|
committer | Kevin Serrano <kevin.serrano@consensys.net> | 2017-10-26 06:45:26 +0800 |
commit | b9bbf8f3290a9b469f4b9f6ee8becad2c76e7044 (patch) | |
tree | b83f55315cdbc00facc834b918eedd0b14dea114 | |
parent | 2489caddd4f42339a98cf0be767ad9cd003ad40c (diff) | |
download | tangerine-wallet-browser-b9bbf8f3290a9b469f4b9f6ee8becad2c76e7044.tar tangerine-wallet-browser-b9bbf8f3290a9b469f4b9f6ee8becad2c76e7044.tar.gz tangerine-wallet-browser-b9bbf8f3290a9b469f4b9f6ee8becad2c76e7044.tar.bz2 tangerine-wallet-browser-b9bbf8f3290a9b469f4b9f6ee8becad2c76e7044.tar.lz tangerine-wallet-browser-b9bbf8f3290a9b469f4b9f6ee8becad2c76e7044.tar.xz tangerine-wallet-browser-b9bbf8f3290a9b469f4b9f6ee8becad2c76e7044.tar.zst tangerine-wallet-browser-b9bbf8f3290a9b469f4b9f6ee8becad2c76e7044.zip |
Resolving that ugly merge.
-rw-r--r-- | app/scripts/inpage.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js index 9e98c044b..b6889b00f 100644 --- a/app/scripts/inpage.js +++ b/app/scripts/inpage.js @@ -1,6 +1,7 @@ /*global Web3*/ cleanContextForImports() require('web3/dist/web3.min.js') +const log = require('loglevel') const LocalMessageDuplexStream = require('post-message-stream') // const PingStream = require('ping-pong-stream/ping') // const endOfStream = require('end-of-stream') @@ -8,6 +9,10 @@ const setupDappAutoReload = require('./lib/auto-reload.js') const MetamaskInpageProvider = require('./lib/inpage-provider.js') restoreContextAfterImports() +const METAMASK_DEBUG = 'GULP_METAMASK_DEBUG' +window.log = log +log.setDefaultLevel(METAMASK_DEBUG ? 'debug' : 'warn') + // // setup plugin communication @@ -28,9 +33,9 @@ var inpageProvider = new MetamaskInpageProvider(metamaskStream) var web3 = new Web3(inpageProvider) web3.setProvider = function () { - console.log('MetaMask - overrode web3.setProvider') + log.debug('MetaMask - overrode web3.setProvider') } -console.log('MetaMask - injected web3') +log.debug('MetaMask - injected web3') // export global web3, with usage-detection setupDappAutoReload(web3, inpageProvider.publicConfigStore) @@ -65,4 +70,3 @@ function restoreContextAfterImports () { console.warn('MetaMask - global.define could not be overwritten.') } } - |