1.0.7 • Published 5 years ago
cysentry v1.0.7
vue框架前端埋点日志sentry使用封装
install dependencies
npm install cysentry
在main.js中引用
import Report from 'cysentry'
let options = {env: 'production', version: '1.0.0'}
env/version必传参数,token/id/username/ip_address/email可选
let sentry = new Report().getInstance(Vue, dsn, options)
Vue.prototype.$sentry = sentry // 设置全局变量
主动上传错误
this.$sentry.log('test')
log(data = null, option = {}, type = 'error') option: env/version必传参数,token/id/username/channel/email可选 type: 'fatal', 'error', 'warning', 'info', and 'debug'. (‘error’ is the default.) ‘fatal’ is the most severe and ‘debug’ is the least.