From 07b67eea4f3b53d294e7bfc7fc50f33e2e877b80 Mon Sep 17 00:00:00 2001 From: kenny-statsig <111380336+kenny-statsig@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:15:18 -0800 Subject: [PATCH] disable logging for error boundary (#439) --- src/ErrorBoundary.ts | 3 +++ src/__tests__/ErrorBoundary.test.ts | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ErrorBoundary.ts b/src/ErrorBoundary.ts index 02550f8..fcde535 100644 --- a/src/ErrorBoundary.ts +++ b/src/ErrorBoundary.ts @@ -80,6 +80,9 @@ export default class ErrorBoundary { error: unknown, { getExtraData, configName }: CaptureOptions = {} ): void { + if (this.sdkOptions.isAllLoggingDisabled()) { + return; + } (async () => { try { const extra = diff --git a/src/__tests__/ErrorBoundary.test.ts b/src/__tests__/ErrorBoundary.test.ts index 6628655..3559dc0 100644 --- a/src/__tests__/ErrorBoundary.test.ts +++ b/src/__tests__/ErrorBoundary.test.ts @@ -42,7 +42,6 @@ describe('ErrorBoundary', () => { beforeEach(() => { options = new StatsigSDKOptions({ api: 'www.google.com', - disableAllLogging: true, loggingBufferMaxSize: 2046, initializeValues: { feature_gates: [] }, userPersistentStorage: new FakeUserPersistentStorage(), @@ -125,7 +124,6 @@ describe('ErrorBoundary', () => { info: err.stack, statsigOptions: { api: 'www.google.com', - disableAllLogging: true, loggingBufferMaxSize: 2046, initializeValues: "set", userPersistentStorage: "set",