Skip to content

Latest commit

 

History

History
49 lines (36 loc) · 887 Bytes

2.2.3 错误追踪服务 Sentry 和 Bugsnag .md

File metadata and controls

49 lines (36 loc) · 887 Bytes

错误追踪服务 Sentry 和 Bugsnag

sentry

npm install --save @sentry/browser
or
yarn add @sentry/browser


import { init, captureMessage } from '@sentry/browser';

init({
  dsn: '__DSN__',
  // ...
});

captureMessage('Hello, world!');

Bugsnag

# npm
npm install --save bugsnag-js bugsnag-vue

# yarn
yarn add bugsnag-js bugsnag-vue
  • use
const bugsnag = require('bugsnag-js')
const bugsnagClient = bugsnag('API_KEY')

// Initialize Vue before we start the BugsnagVue plugin
const Vue = require('vue')
const bugsnagVue = require('bugsnag-vue')

bugsnagClient.use(bugsnagVue(Vue))