Skip to content

Commit 522bb6b

Browse files
author
Luca Forstner
committed
Add logger guard in places it was missed
1 parent b438f8b commit 522bb6b

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

packages/browser/src/transports/utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ export function sendReport(url: string, body: string | Uint8Array): void {
9999
method: 'POST',
100100
credentials: 'omit',
101101
keepalive: true,
102-
}).then(null, error => logger.error(error));
102+
}).then(null, error => {
103+
__DEBUG_BUILD__ && logger.error(error);
104+
});
103105
}
104106
}

packages/nextjs/src/index.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const isVercel = !!process.env.VERCEL;
4141

4242
/** Inits the Sentry NextJS SDK on node. */
4343
export function init(options: NextjsOptions): void {
44-
if (options.debug) {
44+
if (__DEBUG_BUILD__ && options.debug) {
4545
logger.enable();
4646
}
4747

packages/node/src/integrations/utils/errorhandling.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export function logAndExitProcess(error: Error): void {
3030
}
3131
global.process.exit(1);
3232
},
33-
error => logger.error(error),
33+
error => {
34+
__DEBUG_BUILD__ && logger.error(error);
35+
},
3436
);
3537
}

packages/tracing/src/integrations/node/prisma.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@ export class Prisma implements Integration {
6464
if (isValidPrismaClient(options.client)) {
6565
this._client = options.client;
6666
} else {
67-
logger.warn(
68-
`Unsupported Prisma client provided to PrismaIntegration. Provided client: ${JSON.stringify(options.client)}`,
69-
);
67+
__DEBUG_BUILD__ &&
68+
logger.warn(
69+
`Unsupported Prisma client provided to PrismaIntegration. Provided client: ${JSON.stringify(options.client)}`,
70+
);
7071
}
7172
}
7273

0 commit comments

Comments
 (0)