From b3e917c536870ea00e117a897d74bb1c0aafe7f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=81=8F=E5=8F=B3?= Date: Wed, 22 Nov 2017 17:42:23 +0800 Subject: [PATCH] Replace sentry with rollbar (#253) --- package.json | 2 +- src/index.js | 2 +- src/raven.js | 6 ------ src/rollbar.js | 12 ++++++++++++ 4 files changed, 14 insertions(+), 8 deletions(-) delete mode 100644 src/raven.js create mode 100644 src/rollbar.js diff --git a/package.json b/package.json index f7ece858..bfd2b9e5 100755 --- a/package.json +++ b/package.json @@ -68,11 +68,11 @@ "lint-staged": "^4.3.0", "mockjs": "^1.0.1-beta3", "pro-download": "^1.0.0", - "raven-js": "^3.20.1", "react-test-renderer": "^16.0.0", "redbox-react": "^1.3.2", "roadhog": "^1.3.1", "roadhog-api-doc": "^0.2.5", + "rollbar-browser": "^1.9.5", "stylelint": "^8.1.0", "stylelint-config-standard": "^17.0.0" }, diff --git a/src/index.js b/src/index.js index c5eecd8b..c2c10cc4 100644 --- a/src/index.js +++ b/src/index.js @@ -2,7 +2,7 @@ import dva from 'dva'; import 'moment/locale/zh-cn'; import './polyfill'; import './g2'; -import './raven'; +import './rollbar'; // import browserHistory from 'history/createBrowserHistory'; import './index.less'; diff --git a/src/raven.js b/src/raven.js deleted file mode 100644 index 2f51aab7..00000000 --- a/src/raven.js +++ /dev/null @@ -1,6 +0,0 @@ -import Raven from 'raven-js'; - -// Track error by https://sentry.io/ -if (location.host === 'preview.pro.ant.design') { - Raven.config('https://969e74e863854cf0ae7d7d72f534bd3e@sentry.io/247221').install(); -} diff --git a/src/rollbar.js b/src/rollbar.js new file mode 100644 index 00000000..94810fbd --- /dev/null +++ b/src/rollbar.js @@ -0,0 +1,12 @@ +import Rollbar from 'rollbar-browser'; + +// Track error by https://sentry.io/ +if (location.host === 'preview.pro.ant.design') { + Rollbar.init({ + accessToken: '033ca6d7c0eb4cc1831cf470c2649971', + captureUncaught: true, + payload: { + environment: 'production', + }, + }); +} -- GitLab