Skip to content

Commit 1cc219b

Browse files
committed
use enable option instead of if condition
1 parent 361a867 commit 1cc219b

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

instrumentation-client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ function findClosestElementId(
3030
Sentry.init({
3131
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
3232
tracesSampleRate: 0.1,
33+
debug: environment === "development",
3334
environment,
3435
enabled: environment === "production",
3536
beforeBreadcrumb(breadcrumb, hint) {

sentry.edge.config.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ import * as Sentry from "@sentry/nextjs"
22

33
const environment = process.env.NEXT_PUBLIC_CONTEXT || "development"
44

5-
if (environment === "production") {
6-
Sentry.init({
7-
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
8-
tracesSampleRate: 0.1,
9-
debug: false,
10-
environment,
11-
})
12-
}
5+
Sentry.init({
6+
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
7+
tracesSampleRate: 0.1,
8+
debug: environment === "development",
9+
environment,
10+
enabled: environment === "production",
11+
})

sentry.server.config.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ import * as Sentry from "@sentry/nextjs"
22

33
const environment = process.env.NEXT_PUBLIC_CONTEXT || "development"
44

5-
if (environment === "production") {
6-
Sentry.init({
7-
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
8-
tracesSampleRate: 0.1,
9-
debug: false,
10-
environment,
11-
})
12-
}
5+
Sentry.init({
6+
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
7+
tracesSampleRate: 0.1,
8+
debug: environment === "development",
9+
environment,
10+
enabled: environment === "production",
11+
})

0 commit comments

Comments
 (0)