diff --git a/MIGRATION.md b/MIGRATION.md index 129377ba8587..875ece095f68 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -326,6 +326,25 @@ Sentry.init({ }); ``` +- The `_experiments.enableLogs` option was removed. Logs are now enabled by default, so if you were opting in via `_experiments.enableLogs: true` you can simply omit the option. Use the top-level `enableLogs: false` to opt out. + +```js +// before +Sentry.init({ + _experiments: { + enableLogs: true, + }, +}); + +// after: logs are enabled by default, no option needed +Sentry.init({}); + +// or, to opt out +Sentry.init({ + enableLogs: false, +}); +``` + - The deprecated `trackFetchStreamPerformance` option of `browserTracingIntegration` was removed. To track the duration of streamed fetch response bodies, add `fetchStreamPerformanceIntegration()` to your `integrations` array instead. ```js diff --git a/dev-packages/browser-integration-tests/suites/public-api/logger/integration/init.js b/dev-packages/browser-integration-tests/suites/public-api/logger/integration/init.js index cb43cfb52cbb..010c9af592d1 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/logger/integration/init.js +++ b/dev-packages/browser-integration-tests/suites/public-api/logger/integration/init.js @@ -6,10 +6,5 @@ Sentry.init({ traceLifecycle: 'static', dsn: 'https://public@dsn.ingest.sentry.io/1337', enableLogs: true, - // Purposefully specifying the experimental flag here - // to ensure the top level option is used instead. - _experiments: { - enableLogs: false, - }, integrations: [Sentry.consoleLoggingIntegration()], }); diff --git a/packages/core/src/client.ts b/packages/core/src/client.ts index 2b3338bfe7f2..6f74f18e1d28 100644 --- a/packages/core/src/client.ts +++ b/packages/core/src/client.ts @@ -264,10 +264,7 @@ export abstract class Client { }); } - // Backfill enableLogs option from _experiments.enableLogs - // todo(v11): Remove the experimental flag - // eslint-disable-next-line typescript/no-deprecated - this._options.enableLogs = this._options.enableLogs ?? this._options._experiments?.enableLogs ?? true; + this._options.enableLogs ??= true; // Setup log flushing with weight and timeout tracking if (this._options.enableLogs) { diff --git a/packages/core/src/types/options.ts b/packages/core/src/types/options.ts index 51ae35fb7ff0..e5f938082509 100644 --- a/packages/core/src/types/options.ts +++ b/packages/core/src/types/options.ts @@ -449,14 +449,6 @@ export interface ClientOptions Metric | null; - - /** - * Determines if logs support should be enabled. - * - * @default false - * @deprecated Use the top level `enableLogs` option instead. - */ - enableLogs?: boolean; }; /** diff --git a/packages/core/test/lib/client.test.ts b/packages/core/test/lib/client.test.ts index ddc992476533..ccfbc1971fad 100644 --- a/packages/core/test/lib/client.test.ts +++ b/packages/core/test/lib/client.test.ts @@ -2954,22 +2954,6 @@ describe('Client', () => { const client = new TestClient(options); expect(client.getOptions().enableLogs).toBe(false); }); - - it('can be disabled via the experimental option', () => { - const options = getDefaultTestClientOptions({ dsn: PUBLIC_DSN, _experiments: { enableLogs: false } }); - const client = new TestClient(options); - expect(client.getOptions().enableLogs).toBe(false); - }); - - test('top-level option takes precedence over experimental option', () => { - const options = getDefaultTestClientOptions({ - dsn: PUBLIC_DSN, - enableLogs: false, - _experiments: { enableLogs: true }, - }); - const client = new TestClient(options); - expect(client.getOptions().enableLogs).toBe(false); - }); }); describe('log weight-based flushing', () => {