Skip to content

Commit 5953d6e

Browse files
committed
feat(core)!: Make enableLogs option unexperimental
1 parent d7766e9 commit 5953d6e

File tree

24 files changed

+87
-98
lines changed

24 files changed

+87
-98
lines changed

dev-packages/browser-integration-tests/suites/public-api/logger/init.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@ window.Sentry = Sentry;
44

55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
7-
_experiments: {
8-
enableLogs: true,
9-
},
7+
enableLogs: true,
108
});

dev-packages/browser-integration-tests/suites/public-api/logger/integration/init.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ window.Sentry = Sentry;
44

55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
7-
_experiments: {
8-
enableLogs: true,
9-
},
7+
enableLogs: true,
108
integrations: [Sentry.consoleLoggingIntegration()],
119
});

dev-packages/e2e-tests/test-applications/node-express/src/app.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ Sentry.init({
1313
debug: !!process.env.DEBUG,
1414
tunnel: `http://localhost:3031/`, // proxy server
1515
tracesSampleRate: 1,
16-
_experiments: {
17-
enableLogs: true,
18-
},
16+
enableLogs: true,
1917
});
2018

2119
import { TRPCError, initTRPC } from '@trpc/server';

dev-packages/node-core-integration-tests/suites/winston/subject.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ const client = Sentry.init({
88
dsn: 'https://[email protected]/1337',
99
release: '1.0.0',
1010
environment: 'test',
11-
_experiments: {
12-
enableLogs: true,
13-
},
11+
enableLogs: true,
1412
transport: loggingTransport,
1513
});
1614

dev-packages/node-integration-tests/suites/winston/subject.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ Sentry.init({
77
dsn: 'https://[email protected]/1337',
88
release: '1.0.0',
99
environment: 'test',
10-
_experiments: {
11-
enableLogs: true,
12-
},
10+
enableLogs: true,
1311
transport: loggingTransport,
1412
});
1513

packages/browser/src/client.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ export class BrowserClient extends Client<BrowserClientOptions> {
8585

8686
super(opts);
8787

88-
const { sendDefaultPii, sendClientReports, _experiments } = this._options;
89-
const enableLogs = _experiments?.enableLogs;
88+
const { sendDefaultPii, sendClientReports, enableLogs } = this._options;
9089

9190
if (WINDOW.document && (sendClientReports || enableLogs)) {
9291
WINDOW.document.addEventListener('visibilitychange', () => {

packages/browser/src/log.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function captureLog(
1919
}
2020

2121
/**
22-
* @summary Capture a log with the `trace` level. Requires `_experiments.enableLogs` to be enabled.
22+
* @summary Capture a log with the `trace` level. Requires the `enableLogs` option to be enabled.
2323
*
2424
* @param message - The message to log.
2525
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { userId: 100, route: '/dashboard' }.
@@ -48,7 +48,7 @@ export function trace(message: ParameterizedString, attributes?: Log['attributes
4848
}
4949

5050
/**
51-
* @summary Capture a log with the `debug` level. Requires `_experiments.enableLogs` to be enabled.
51+
* @summary Capture a log with the `debug` level. Requires the `enableLogs` option to be enabled.
5252
*
5353
* @param message - The message to log.
5454
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { component: 'Header', state: 'loading' }.
@@ -78,7 +78,7 @@ export function debug(message: ParameterizedString, attributes?: Log['attributes
7878
}
7979

8080
/**
81-
* @summary Capture a log with the `info` level. Requires `_experiments.enableLogs` to be enabled.
81+
* @summary Capture a log with the `info` level. Requires the `enableLogs` option to be enabled.
8282
*
8383
* @param message - The message to log.
8484
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { feature: 'checkout', status: 'completed' }.
@@ -108,7 +108,7 @@ export function info(message: ParameterizedString, attributes?: Log['attributes'
108108
}
109109

110110
/**
111-
* @summary Capture a log with the `warn` level. Requires `_experiments.enableLogs` to be enabled.
111+
* @summary Capture a log with the `warn` level. Requires the `enableLogs` option to be enabled.
112112
*
113113
* @param message - The message to log.
114114
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { browser: 'Chrome', version: '91.0' }.
@@ -139,7 +139,7 @@ export function warn(message: ParameterizedString, attributes?: Log['attributes'
139139
}
140140

141141
/**
142-
* @summary Capture a log with the `error` level. Requires `_experiments.enableLogs` to be enabled.
142+
* @summary Capture a log with the `error` level. Requires the `enableLogs` option to be enabled.
143143
*
144144
* @param message - The message to log.
145145
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { error: 'NetworkError', url: '/api/data' }.
@@ -171,7 +171,7 @@ export function error(message: ParameterizedString, attributes?: Log['attributes
171171
}
172172

173173
/**
174-
* @summary Capture a log with the `fatal` level. Requires `_experiments.enableLogs` to be enabled.
174+
* @summary Capture a log with the `fatal` level. Requires the `enableLogs` option to be enabled.
175175
*
176176
* @param message - The message to log.
177177
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { appState: 'corrupted', sessionId: 'abc-123' }.

packages/browser/test/client.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('BrowserClient', () => {
2727
it('does not flush logs when logs are disabled', () => {
2828
client = new BrowserClient(
2929
getDefaultBrowserClientOptions({
30-
_experiments: { enableLogs: false },
30+
enableLogs: true,
3131
sendClientReports: true,
3232
}),
3333
);
@@ -50,7 +50,7 @@ describe('BrowserClient', () => {
5050
vi.useFakeTimers();
5151
client = new BrowserClient(
5252
getDefaultBrowserClientOptions({
53-
_experiments: { enableLogs: true },
53+
enableLogs: true,
5454
sendClientReports: true,
5555
}),
5656
);

packages/browser/test/log.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ describe('Logger', () => {
4242
init({
4343
dsn,
4444
transport: makeSimpleTransport,
45-
_experiments: {
46-
enableLogs: true,
47-
},
45+
enableLogs: true,
4846
});
4947
});
5048

packages/cloudflare/src/logs/exports.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function captureLog(
1919
}
2020

2121
/**
22-
* @summary Capture a log with the `trace` level. Requires `_experiments.enableLogs` to be enabled.
22+
* @summary Capture a log with the `trace` level. Requires the `enableLogs` option to be enabled.
2323
*
2424
* @param message - The message to log.
2525
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { userId: 100, route: '/dashboard' }.
@@ -48,7 +48,7 @@ export function trace(message: ParameterizedString, attributes?: Log['attributes
4848
}
4949

5050
/**
51-
* @summary Capture a log with the `debug` level. Requires `_experiments.enableLogs` to be enabled.
51+
* @summary Capture a log with the `debug` level. Requires the `enableLogs` option to be enabled.
5252
*
5353
* @param message - The message to log.
5454
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { component: 'Header', state: 'loading' }.
@@ -78,7 +78,7 @@ export function debug(message: ParameterizedString, attributes?: Log['attributes
7878
}
7979

8080
/**
81-
* @summary Capture a log with the `info` level. Requires `_experiments.enableLogs` to be enabled.
81+
* @summary Capture a log with the `info` level. Requires the `enableLogs` option to be enabled.
8282
*
8383
* @param message - The message to log.
8484
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { feature: 'checkout', status: 'completed' }.
@@ -108,7 +108,7 @@ export function info(message: ParameterizedString, attributes?: Log['attributes'
108108
}
109109

110110
/**
111-
* @summary Capture a log with the `warn` level. Requires `_experiments.enableLogs` to be enabled.
111+
* @summary Capture a log with the `warn` level. Requires the `enableLogs` option to be enabled.
112112
*
113113
* @param message - The message to log.
114114
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { browser: 'Chrome', version: '91.0' }.
@@ -139,7 +139,7 @@ export function warn(message: ParameterizedString, attributes?: Log['attributes'
139139
}
140140

141141
/**
142-
* @summary Capture a log with the `error` level. Requires `_experiments.enableLogs` to be enabled.
142+
* @summary Capture a log with the `error` level. Requires the `enableLogs` option to be enabled.
143143
*
144144
* @param message - The message to log.
145145
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { error: 'NetworkError', url: '/api/data' }.
@@ -171,7 +171,7 @@ export function error(message: ParameterizedString, attributes?: Log['attributes
171171
}
172172

173173
/**
174-
* @summary Capture a log with the `fatal` level. Requires `_experiments.enableLogs` to be enabled.
174+
* @summary Capture a log with the `fatal` level. Requires the `enableLogs` option to be enabled.
175175
*
176176
* @param message - The message to log.
177177
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { appState: 'corrupted', sessionId: 'abc-123' }.

0 commit comments

Comments
 (0)