自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Sentry 開(kāi)發(fā)者貢獻(xiàn)指南 - JavaScript SDK Minimal

開(kāi)發(fā) 前端
它允許庫(kù)作者添加對(duì) Sentry SDK 的支持,而無(wú)需捆綁整個(gè) SDK 或依賴于特定平臺(tái)。簡(jiǎn)單來(lái)說(shuō),它是 @sentry/node 或 @sentry/browser 等特定于平臺(tái)的 SDK 庫(kù)的公共基礎(chǔ)部分。

簡(jiǎn)介

嵌入到應(yīng)用程序中時(shí)使用配置 ??client??? 的最小 ??Sentry SDK???。它允許??庫(kù)作者???添加對(duì) ??Sentry SDK?? 的支持,而無(wú)需捆綁整個(gè) ??SDK??? 或依賴于特定平臺(tái)。簡(jiǎn)單來(lái)說(shuō),它是 ??@sentry/node??? 或 ??@sentry/browser?? 等特定于平臺(tái)的 SDK 庫(kù)的公共基礎(chǔ)部分。

Sentry JavaScript SDK Minimal

用法

要使用 ??minimal???,您不必初始化 ??SDK???。這應(yīng)該由您庫(kù)的用戶處理。而是直接使用 ??@sentry/minimal?? 的導(dǎo)出函數(shù)添加面包屑或捕獲事件:

import * as Sentry from '@sentry/minimal';

// 為未來(lái)的事件添加面包屑
Sentry.addBreadcrumb({
message: 'My Breadcrumb',
// ...
});

// 捕獲異常、消息或手動(dòng)事件
Sentry.captureMessage('Hello, world!');
Sentry.captureException(new Error('Good bye'));
Sentry.captureEvent({
message: 'Manual',
stacktrace: [
// ...
],
});

請(qǐng)注意,雖然嚴(yán)格可行,但不鼓勵(lì)干擾事件上下文。如果由于某種原因您的庫(kù)需要注入上下文信息,請(qǐng)注意這可能會(huì)覆蓋用戶的上下文值:

// 設(shè)置用戶信息、標(biāo)簽和其他附加信息
Sentry.configureScope(scope => {
scope.setExtra('battery', 0.7);
scope.setTag('user_mode', 'admin');
scope.setUser({ id: '4711' });
// scope.clear();
});

測(cè)試用例

PASS  test/lib/minimal.test.ts
Minimal
? Clear Scope (1ms)
? returns undefined before binding a client (1ms)
? returns the bound client (1ms)
? Calls function on the client (1ms)
? does not throw an error when pushing different clients (1ms)
? does not throw an error when pushing same clients
? custom carrier (1ms)
? withScope (2ms)
? setExtras (1ms)
? setTags (1ms)
? setExtra (1ms)
? setTag
? setUser (1ms)
? setContext (1ms)
Capture
? Return an event_id (4ms)
? Exception (1ms)
? Exception with explicit scope (1ms)
? Message (1ms)
? Message with explicit scope (1ms)
? Message with custom level (2ms)
? Event (1ms)
configureScope
? User Context (2ms)
? Extra Context (1ms)
? Tags Context (1ms)
? Fingerprint
? Level (1ms)


責(zé)任編輯:武曉燕 來(lái)源: 黑客下午茶
相關(guān)推薦

2022-01-02 23:26:08

開(kāi)發(fā)SDK Sentry

2021-12-25 22:31:55

Sentry 監(jiān)控SDK 開(kāi)發(fā) 性能監(jiān)控

2021-12-31 18:35:40

監(jiān)控Sentry開(kāi)發(fā)

2022-01-03 22:59:30

開(kāi)發(fā)SDK數(shù)據(jù)

2022-01-02 06:59:43

SentrySDK 開(kāi)發(fā)客戶端報(bào)告

2022-01-11 20:42:54

開(kāi)發(fā)Sentry標(biāo)志

2022-01-17 19:34:43

SentryWeb APISentry API

2022-01-15 23:33:47

SentryPyCharm配置

2022-01-18 23:26:45

開(kāi)發(fā)

2022-01-19 19:49:53

Sentry瀏覽器SDK

2021-12-15 20:06:48

ReactJSSentry開(kāi)發(fā)者

2022-01-16 22:16:59

數(shù)據(jù)庫(kù)Sentry開(kāi)發(fā)者

2022-01-13 20:13:31

元宇宙搜索引擎

2021-12-16 20:12:37

后端開(kāi)發(fā)Sentry

2022-01-20 19:49:10

Sentry開(kāi)發(fā)Scope

2021-12-17 19:15:51

前端蟲(chóng)洞狀態(tài)

2021-11-17 18:38:32

avaScriptSDK調(diào)試

2019-02-21 13:40:35

Javascript面試前端

2015-07-22 16:08:46

OpenStack開(kāi)源貢獻(xiàn)代碼

2018-03-27 23:25:40

Paddle
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)