【发布时间】:2021-03-04 05:04:06
【问题描述】:
如果我想捕获 Sentry 消息并包含在 Sentry 范围上设置的用户信息,我该怎么做?
例如,如果我将用户 ID 设置为范围
Sentry.configureScope(scope => scope.setUser({ id: '123' }))
然后如果我想发送像"User 123 could not send message 456"这样的哨兵消息
Sentry.captureMessage(`User ${userId} could not send message ${messageId}`)
我可以从周围的代码中获取消息 ID,但是如何访问我在此上下文中在作用域上设置的 user.id?
【问题讨论】:
标签: javascript sentry