diff options
author | kumavis <aaron@kumavis.me> | 2018-03-01 02:37:53 +0800 |
---|---|---|
committer | kumavis <aaron@kumavis.me> | 2018-03-01 02:37:53 +0800 |
commit | fca2cbc8ef8e0d8434fd8c437497a7a0792e2caf (patch) | |
tree | 3765253b89d2dd416905d71be5a4906dcb660db5 /app/scripts/lib | |
parent | 40484b1c1ff2b8828d6764c1ba7bcf20730c4a30 (diff) | |
download | tangerine-wallet-browser-fca2cbc8ef8e0d8434fd8c437497a7a0792e2caf.tar.gz tangerine-wallet-browser-fca2cbc8ef8e0d8434fd8c437497a7a0792e2caf.tar.zst tangerine-wallet-browser-fca2cbc8ef8e0d8434fd8c437497a7a0792e2caf.zip |
sentry - clean - move setupRaven to lib
Diffstat (limited to 'app/scripts/lib')
-rw-r--r-- | app/scripts/lib/setupRaven.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/app/scripts/lib/setupRaven.js b/app/scripts/lib/setupRaven.js new file mode 100644 index 000000000..42e48cb90 --- /dev/null +++ b/app/scripts/lib/setupRaven.js @@ -0,0 +1,26 @@ +const Raven = require('../vendor/raven.min.js') +const METAMASK_DEBUG = 'GULP_METAMASK_DEBUG' +const PROD = 'https://3567c198f8a8412082d32655da2961d0@sentry.io/273505' +const DEV = 'https://f59f3dd640d2429d9d0e2445a87ea8e1@sentry.io/273496' + +module.exports = setupRaven + +// Setup raven / sentry remote error reporting +function setupRaven(opts) { + const { release } = opts + let ravenTarget + + if (METAMASK_DEBUG) { + console.log('Setting up Sentry Remote Error Reporting: DEV') + ravenTarget = DEV + } else { + console.log('Setting up Sentry Remote Error Reporting: PROD') + ravenTarget = PROD + } + + Raven.config(ravenTarget, { + release, + }).install() + + return Raven +} |