Skip to content

Commit e5f2c76

Browse files
nicohrubecclaude
andcommitted
docs(logs): Remove stale "requires enableLogs" references
Logs default to `true` now, so the JSDoc note that the logger API and logging integrations require `enableLogs` to be enabled is no longer accurate. Drop the clause, the redundant `enableLogs: true` from init examples/READMEs, and the `_experiments.enableLogs` flag from the shared browser logger test init. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent de83bc9 commit e5f2c76

9 files changed

Lines changed: 28 additions & 30 deletions

File tree

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,4 @@ window.Sentry = Sentry;
55
Sentry.init({
66
traceLifecycle: 'static',
77
dsn: 'https://public@dsn.ingest.sentry.io/1337',
8-
// purposefully testing against the experimental flag here
9-
_experiments: {
10-
enableLogs: true,
11-
},
128
});

‎packages/core/src/integrations/consola.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export interface ConsolaLogObject {
191191
const DEFAULT_CAPTURED_LEVELS: Array<LogSeverityLevel> = ['trace', 'debug', 'info', 'warn', 'error', 'fatal'];
192192

193193
/**
194-
* Creates a new Sentry reporter for Consola that forwards logs to Sentry. Requires the `enableLogs` option to be enabled.
194+
* Creates a new Sentry reporter for Consola that forwards logs to Sentry.
195195
*
196196
* **Note: This integration supports Consola v3.x only.** The reporter interface and log object structure
197197
* may differ in other versions of Consola.
@@ -205,7 +205,7 @@ const DEFAULT_CAPTURED_LEVELS: Array<LogSeverityLevel> = ['trace', 'debug', 'inf
205205
* import { consola } from 'consola';
206206
*
207207
* Sentry.init({
208-
* enableLogs: true,
208+
* dsn: '__DSN__',
209209
* });
210210
*
211211
* const sentryReporter = Sentry.createConsolaReporter({

‎packages/core/src/logs/console-integration.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const _consoleLoggingIntegration = ((options: Partial<CaptureConsoleOptions> = {
9595
}) satisfies IntegrationFn;
9696

9797
/**
98-
* Captures calls to the `console` API as logs in Sentry. Requires the `enableLogs` option to be enabled.
98+
* Captures calls to the `console` API as logs in Sentry.
9999
*
100100
* @experimental This feature is experimental and may be changed or removed in future versions.
101101
*
@@ -109,7 +109,6 @@ const _consoleLoggingIntegration = ((options: Partial<CaptureConsoleOptions> = {
109109
* import * as Sentry from '@sentry/browser';
110110
*
111111
* Sentry.init({
112-
* enableLogs: true,
113112
* integrations: [Sentry.consoleLoggingIntegration({ levels: ['error', 'warn'] })],
114113
* });
115114
* ```

‎packages/core/src/logs/public-api.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ interface CaptureLogMetadata {
3030
}
3131

3232
/**
33-
* @summary Capture a log with the `trace` level. Requires the `enableLogs` option to be enabled.
33+
* @summary Capture a log with the `trace` level.
3434
*
3535
* @param message - The message to log.
3636
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { userId: 100, route: '/dashboard' }.
@@ -64,7 +64,7 @@ export function trace(
6464
}
6565

6666
/**
67-
* @summary Capture a log with the `debug` level. Requires the `enableLogs` option to be enabled.
67+
* @summary Capture a log with the `debug` level.
6868
*
6969
* @param message - The message to log.
7070
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { component: 'Header', state: 'loading' }.
@@ -99,7 +99,7 @@ export function debug(
9999
}
100100

101101
/**
102-
* @summary Capture a log with the `info` level. Requires the `enableLogs` option to be enabled.
102+
* @summary Capture a log with the `info` level.
103103
*
104104
* @param message - The message to log.
105105
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { feature: 'checkout', status: 'completed' }.
@@ -134,7 +134,7 @@ export function info(
134134
}
135135

136136
/**
137-
* @summary Capture a log with the `warn` level. Requires the `enableLogs` option to be enabled.
137+
* @summary Capture a log with the `warn` level.
138138
*
139139
* @param message - The message to log.
140140
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { browser: 'Chrome', version: '91.0' }.
@@ -170,7 +170,7 @@ export function warn(
170170
}
171171

172172
/**
173-
* @summary Capture a log with the `error` level. Requires the `enableLogs` option to be enabled.
173+
* @summary Capture a log with the `error` level.
174174
*
175175
* @param message - The message to log.
176176
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { error: 'NetworkError', url: '/api/data' }.
@@ -207,7 +207,7 @@ export function error(
207207
}
208208

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

‎packages/core/test/lib/client.test.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,12 @@ describe('Client', () => {
103103
const options = getDefaultTestClientOptions({ dsn: PUBLIC_DSN, test: true });
104104
const client = new TestClient(options);
105105

106-
expect(client.getOptions()).toEqual({ attachStacktrace: true, traceLifecycle: 'stream', ...options, enableLogs: true });
106+
expect(client.getOptions()).toEqual({
107+
attachStacktrace: true,
108+
traceLifecycle: 'stream',
109+
...options,
110+
enableLogs: true,
111+
});
107112
});
108113

109114
test('defaults traceLifecycle to stream', () => {

‎packages/effect/README.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ const SentryLive = Layer.mergeAll(
2727
Sentry.effectLayer({
2828
dsn: '__DSN__',
2929
tracesSampleRate: 1.0,
30-
enableLogs: true,
3130
}),
3231
Layer.setTracer(Sentry.SentryEffectTracer),
3332
Logger.replace(Logger.defaultLogger, Sentry.SentryEffectLogger),
@@ -59,7 +58,6 @@ const SentryLive = Layer.mergeAll(
5958
Sentry.effectLayer({
6059
dsn: '__DSN__',
6160
tracesSampleRate: 1.0,
62-
enableLogs: true,
6361
}),
6462
Layer.succeed(Tracer.Tracer, Sentry.SentryEffectTracer),
6563
Logger.layer([Sentry.SentryEffectLogger]),

‎packages/node/src/integrations/winston.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ interface WinstonTransportOptions {
4545
}
4646

4747
/**
48-
* Creates a new Sentry Winston transport that fowards logs to Sentry. Requires the `enableLogs` option to be enabled.
48+
* Creates a new Sentry Winston transport that fowards logs to Sentry.
4949
*
5050
* Supports Winston 3.x.x.
5151
*

‎packages/node/src/logs/exports.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { captureLog, type CaptureLogArgs } from './capture';
22

33
/**
4-
* @summary Capture a log with the `trace` level. Requires the `enableLogs` option to be enabled.
4+
* @summary Capture a log with the `trace` level.
55
*
66
* You can either pass a message and attributes or a message template, params and attributes.
77
*
@@ -28,7 +28,7 @@ export function trace(...args: CaptureLogArgs): void {
2828
}
2929

3030
/**
31-
* @summary Capture a log with the `debug` level. Requires the `enableLogs` option to be enabled.
31+
* @summary Capture a log with the `debug` level.
3232
*
3333
* You can either pass a message and attributes or a message template, params and attributes.
3434
*
@@ -55,7 +55,7 @@ export function debug(...args: CaptureLogArgs): void {
5555
}
5656

5757
/**
58-
* @summary Capture a log with the `info` level. Requires the `enableLogs` option to be enabled.
58+
* @summary Capture a log with the `info` level.
5959
*
6060
* You can either pass a message and attributes or a message template, params and attributes.
6161
*
@@ -82,7 +82,7 @@ export function info(...args: CaptureLogArgs): void {
8282
}
8383

8484
/**
85-
* @summary Capture a log with the `warn` level. Requires the `enableLogs` option to be enabled.
85+
* @summary Capture a log with the `warn` level.
8686
*
8787
* You can either pass a message and attributes or a message template, params and attributes.
8888
*
@@ -110,7 +110,7 @@ export function warn(...args: CaptureLogArgs): void {
110110
}
111111

112112
/**
113-
* @summary Capture a log with the `error` level. Requires the `enableLogs` option to be enabled.
113+
* @summary Capture a log with the `error` level.
114114
*
115115
* You can either pass a message and attributes or a message template, params and attributes.
116116
*
@@ -138,7 +138,7 @@ export function error(...args: CaptureLogArgs): void {
138138
}
139139

140140
/**
141-
* @summary Capture a log with the `fatal` level. Requires the `enableLogs` option to be enabled.
141+
* @summary Capture a log with the `fatal` level.
142142
*
143143
* You can either pass a message and attributes or a message template, params and attributes.
144144
*

‎packages/vercel-edge/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 the `enableLogs` option to be enabled.
22+
* @summary Capture a log with the `trace` level.
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 the `enableLogs` option to be enabled.
51+
* @summary Capture a log with the `debug` level.
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 the `enableLogs` option to be enabled.
81+
* @summary Capture a log with the `info` level.
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 the `enableLogs` option to be enabled.
111+
* @summary Capture a log with the `warn` level.
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 the `enableLogs` option to be enabled.
142+
* @summary Capture a log with the `error` level.
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 the `enableLogs` option to be enabled.
174+
* @summary Capture a log with the `fatal` level.
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)