Skip to content

Commit 6e42f4f

Browse files
authored
feat(logs): Add Log exports to browser and node packages (#18857)
closes https://linear.app/getsentry/issue/FE-680/qq-from-discord
1 parent 350909d commit 6e42f4f

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import * as Sentry from '@sentry/nextjs';
2+
import type { Log } from '@sentry/nextjs';
23

34
Sentry.init({
45
environment: 'qa', // dynamic sampling bias to keep transactions
56
dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN,
67
tunnel: `http://localhost:3031/`, // proxy server
78
tracesSampleRate: 1.0,
89
sendDefaultPii: true,
10+
// Verify Log type is available
11+
beforeSendLog(log: Log) {
12+
return log;
13+
},
914
});
1015

1116
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;

dev-packages/e2e-tests/test-applications/nextjs-16/sentry.server.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as Sentry from '@sentry/nextjs';
2+
import { Log } from '@sentry/nextjs';
23

34
Sentry.init({
45
environment: 'qa', // dynamic sampling bias to keep transactions
@@ -8,4 +9,8 @@ Sentry.init({
89
sendDefaultPii: true,
910
// debug: true,
1011
integrations: [Sentry.vercelAIIntegration()],
12+
// Verify Log type is available
13+
beforeSendLog(log: Log) {
14+
return log;
15+
},
1116
});

packages/browser/src/exports.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export type {
1818
ReportDialogOptions,
1919
CaptureContext,
2020
ExclusiveEventHintOrCaptureContext,
21+
Log,
22+
LogSeverityLevel,
2123
} from '@sentry/core';
2224

2325
export type { BrowserOptions } from './client';

packages/node/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ export type {
158158
User,
159159
Span,
160160
Metric,
161+
Log,
162+
LogSeverityLevel,
161163
FeatureFlagsIntegration,
162164
ExclusiveEventHintOrCaptureContext,
163165
CaptureContext,

0 commit comments

Comments
 (0)