Comments (17)
可以看一下源码 src/raven.js 的第 1888 行
if (this._globalOptions.environment === 'production') {
wx.request({
url: opts.url + '?' + urlencode(opts.auth),
method: 'POST',
header: {
'content-type': 'text/plain;charset=UTF-8'
},
data: stringify(opts.data),
success: function() {
opts.onSuccess && opts.onSuccess();
},
fail: function(err) {
opts.onError && opts.onError(err);
}
});
}
所以,你应该在代码中指定 environment
options = {
environment: '指定为production才会上报'
}
from raven-weapp.
已经指定 environment为production 还是没有上报信息
会自动上报console.log信息吗 还是需要手动触发 @x-bao
from raven-weapp.
console.log
的内容会自动捕捉,然后放到这个位置(见下图)
你也可以使用sentry
的相关 API 手动触发:
- Raven.captureMessage(msg, option)
- Raven.captureBreadcrumb
详情参考 sentry
的官方文档。
from raven-weapp.
准确的说是:触发Raven.captureMessage(msg, option)
之后,才会把页面中的 console.log
相关的信息给捕获 & 打印来。如果你只是 console.log
,在 sentry 里边是收不到任何消息的
from raven-weapp.
我在app.js里面 这样测试的 还是收不到上报的信息 请你帮忙看看 谢谢
import appname from './common/appname.js'
let services = require('./services/services.js');
var Raven = require('./raven/raven.min.js')
Raven.config('http://[email protected]/7', options).install()
var msg = 'test';
Raven.captureMessage(msg)
App({
globalData: {
userInfo: null,
class_id:null, //保存当前选择的编辑类型
counselor_user_id:'', //在顾问端时存储用户id 用于查找优惠券与兑换优惠券
},
onLaunch: function () {
wx.login({
success: function (res) {
if (res.code) {
// //发起网络请求
services.request({
url: 'services/auth/mini_program/deJsCode',
method: 'POST',
data: {
code: res.code,
appname: appname,
},
}).then((res) => {
if (res.code === 0) {
wx.setStorage({
key: "wxLoginKey",
data: res.wx_login_key,
})
}
})
} else {
console.log('登录失败!' + res.errMsg)
}
}
});
},
})
from raven-weapp.
看上一条回复。
还是不行就先把 sentry 的文档看一遍吧。先把 web 的搞清楚,然后再来看小程序的。
from raven-weapp.
看上一条回复。
还是不行就先把 sentry 的文档看一遍吧。先把 web 的搞清楚,然后再来看小程序的。
from raven-weapp.
@x-bao 已经用了很久时间的Web版了 都正常
小程序这个收不到上报信息 你怎么配置的 帮忙看看
from raven-weapp.
文档怎么写,我就是怎么做的。多试试
from raven-weapp.
OK 你那边使用正常? @x-bao
from raven-weapp.
一切正常,做了一点小优化。提了 pull request,但是没有人理...
from raven-weapp.
可以看一下源码 src/raven.js 的第 1888 行
if (this._globalOptions.environment === 'production') { wx.request({ url: opts.url + '?' + urlencode(opts.auth), method: 'POST', header: { 'content-type': 'text/plain;charset=UTF-8' }, data: stringify(opts.data), success: function() { opts.onSuccess && opts.onSuccess(); }, fail: function(err) { opts.onError && opts.onError(err); } }); }
所以,你应该在代码中指定
environment
options = { environment: '指定为production才会上报' }
请问您小程序有用什么开源的框架吗?
我用的mpvue,正常引入npm run dev 或者 npm run build 均报错
from raven-weapp.
一切正常,做了一点小优化。提了 pull request,但是没有人理...
执行npm run dev 出现这个报错
This relative module was not found:
- ../utils/raven-weapp/build/raven.min.js in ./node_modules/mpvue-entry/dist/cardReserve.js, ./node_modules/mpvue-entry/dist/demoSlide.js and 32 others
from raven-weapp.
已经指定 environment为production 还是没有上报信息
会自动上报console.log信息吗 还是需要手动触发 @x-bao
请问你最后是捕获到了吗?
from raven-weapp.
没有捕获到
from raven-weapp.
已经解决了
from raven-weapp.
Thanks @qinghua5453
from raven-weapp.
Related Issues (10)
- require('./utils/raven-weapp/build/raven')提示This relative module was not found
- sentry.io未经过ICP备案,接了也不能用? HOT 2
- mpvue不能接入
- 请教下, 你们 sdk 主要做了哪些针对小程序的优化?
- 自动捕捉console无效
- 小程序 request 合法域名
- 不上报任何的信息啊 HOT 2
- sentry创建工程选择什么语言呢 HOT 1
- 小程序中并没有document.createEvent 或 H.createEventObject啊,会报H.createEventObject is not a function HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raven-weapp.