Skip to content

Commit 3234dba

Browse files
AbhiPrasadandreiborza
authored andcommitted
feat(core)!: Make beforeSendLog option unexperimental
1 parent 2e0663a commit 3234dba

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

packages/core/src/logs/exports.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ export function _INTERNAL_captureLog(
124124
return;
125125
}
126126

127-
const { _experiments, release, environment, enableLogs = false } = client.getOptions();
128-
const { beforeSendLog } = _experiments ?? {};
127+
const { release, environment, enableLogs = false, beforeSendLog } = client.getOptions();
129128
if (!enableLogs) {
130129
DEBUG_BUILD && debug.warn('logging option not enabled, log will not be captured.');
131130
return;

packages/core/src/types-hoist/options.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -246,19 +246,6 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
246246
_experiments?: {
247247
// eslint-disable-next-line @typescript-eslint/no-explicit-any
248248
[key: string]: any;
249-
/**
250-
* An event-processing callback for logs, guaranteed to be invoked after all other log
251-
* processors. This allows a log to be modified or dropped before it's sent.
252-
*
253-
* Note that you must return a valid log from this callback. If you do not wish to modify the log, simply return
254-
* it at the end. Returning `null` will cause the log to be dropped.
255-
*
256-
* @default undefined
257-
*
258-
* @param log The log generated by the SDK.
259-
* @returns A new log that will be sent | null.
260-
*/
261-
beforeSendLog?: (log: Log) => Log | null;
262249
};
263250

264251
/**
@@ -329,6 +316,20 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
329316
*/
330317
enableLogs?: boolean;
331318

319+
/**
320+
* An event-processing callback for logs, guaranteed to be invoked after all other log
321+
* processors. This allows a log to be modified or dropped before it's sent.
322+
*
323+
* Note that you must return a valid log from this callback. If you do not wish to modify the log, simply return
324+
* it at the end. Returning `null` will cause the log to be dropped.
325+
*
326+
* @default undefined
327+
*
328+
* @param log The log generated by the SDK.
329+
* @returns A new log that will be sent | null.
330+
*/
331+
beforeSendLog?: (log: Log) => Log | null;
332+
332333
/**
333334
* Function to compute tracing sample rate dynamically and filter unwanted traces.
334335
*

packages/core/test/lib/logs/exports.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ describe('_INTERNAL_captureLog', () => {
291291
const options = getDefaultTestClientOptions({
292292
dsn: PUBLIC_DSN,
293293
enableLogs: true,
294-
_experiments: { beforeSendLog },
294+
beforeSendLog,
295295
});
296296
const client = new TestClient(options);
297297

@@ -338,7 +338,7 @@ describe('_INTERNAL_captureLog', () => {
338338
const options = getDefaultTestClientOptions({
339339
dsn: PUBLIC_DSN,
340340
enableLogs: true,
341-
_experiments: { beforeSendLog },
341+
beforeSendLog,
342342
});
343343
const client = new TestClient(options);
344344

0 commit comments

Comments
 (0)