Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sentry error logging #101

Merged
merged 5 commits into from
Feb 26, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 68 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"@fortawesome/free-brands-svg-icons": "^5.12.0",
"@fortawesome/free-solid-svg-icons": "^5.12.0",
"@fortawesome/vue-fontawesome": "^0.1.9",
"@sentry/browser": "^5.12.5",
"@sentry/integrations": "^5.12.5",
"buefy": "^0.8.8",
"clipboard": "^2.0.4",
"core-js": "^3.6.1",
Expand Down
16 changes: 16 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import VueAnalytics from 'vue-analytics'
import App from './App.vue'
import store from './store'

import * as Sentry from '@sentry/browser'
import * as Integrations from '@sentry/integrations'

import { library } from '@fortawesome/fontawesome-svg-core'
import { faCopy } from '@fortawesome/free-solid-svg-icons/faCopy'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
Expand Down Expand Up @@ -33,6 +36,19 @@ if (process.env.NODE_ENV === 'production') {
})
}

Sentry.init({
dsn: process.env.NODE_ENV === 'production'
? 'https://8c09726e231d4cf780c541f40d3639a9@sentry.io/3009295' // cc-chooser-prod project
: 'https://ab63acb8c1464466869182dd53c7046d@sentry.io/3009597', // cc-chooser-dev project
integrations: [
new Integrations.Vue({
Vue,
attachProps: true,
logErrors: !process.env.NODE_ENV === 'production' // Only log errors in dev env
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why aren't we logging errors in production?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This flag enables/ disables error logging from the Vue renderer, from Sentry's Vue docs:
Passing in logErrors is optional and is false if it is not provided. If you set it to true, Sentry will call original Vue’s logError function as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

})
]
})

new Vue({
store,
i18n,
Expand Down