Skip to content

Commit c3a2281

Browse files
committed
ref(browser-utils): Use debug instead of logger
1 parent cbff908 commit c3a2281

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

packages/browser-utils/src/getNativeImplementation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isNativeFunction, logger } from '@sentry/core';
1+
import { debug, isNativeFunction } from '@sentry/core';
22
import { DEBUG_BUILD } from './debug-build';
33
import { WINDOW } from './types';
44

@@ -53,7 +53,7 @@ export function getNativeImplementation<T extends keyof CacheableImplementations
5353
document.head.removeChild(sandbox);
5454
} catch (e) {
5555
// Could not create sandbox iframe, just use window.xxx
56-
DEBUG_BUILD && logger.warn(`Could not create sandbox iframe for ${name} check, bailing to window.${name}: `, e);
56+
DEBUG_BUILD && debug.warn(`Could not create sandbox iframe for ${name} check, bailing to window.${name}: `, e);
5757
}
5858
}
5959

packages/browser-utils/src/metrics/cls.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { Client, SpanAttributes } from '@sentry/core';
22
import {
33
browserPerformanceTimeOrigin,
4+
debug,
45
getCurrentScope,
56
htmlTreeAsString,
6-
logger,
77
SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME,
88
SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT,
99
SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE,
@@ -53,7 +53,7 @@ function sendStandaloneClsSpan(
5353
pageloadSpanId: string,
5454
reportEvent: WebVitalReportEvent,
5555
) {
56-
DEBUG_BUILD && logger.log(`Sending CLS span (${clsValue})`);
56+
DEBUG_BUILD && debug.log(`Sending CLS span (${clsValue})`);
5757

5858
const startTime = msToSec((browserPerformanceTimeOrigin() || 0) + (entry?.startTime || 0));
5959
const routeName = getCurrentScope().getScopeData().transactionName;

packages/browser-utils/src/metrics/instrument.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getFunctionName, logger } from '@sentry/core';
1+
import { debug, getFunctionName } from '@sentry/core';
22
import { DEBUG_BUILD } from '../debug-build';
33
import { onCLS } from './web-vitals/getCLS';
44
import { onFID } from './web-vitals/getFID';
@@ -214,7 +214,7 @@ function triggerHandlers(type: InstrumentHandlerType, data: unknown): void {
214214
handler(data);
215215
} catch (e) {
216216
DEBUG_BUILD &&
217-
logger.error(
217+
debug.error(
218218
`Error while triggering instrumentation handler.\nType: ${type}\nName: ${getFunctionName(handler)}\nError:`,
219219
e,
220220
);

packages/browser-utils/src/metrics/lcp.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { Client, SpanAttributes } from '@sentry/core';
22
import {
33
browserPerformanceTimeOrigin,
4+
debug,
45
getCurrentScope,
56
htmlTreeAsString,
6-
logger,
77
SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME,
88
SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT,
99
SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE,
@@ -56,7 +56,7 @@ export function _sendStandaloneLcpSpan(
5656
pageloadSpanId: string,
5757
reportEvent: WebVitalReportEvent,
5858
) {
59-
DEBUG_BUILD && logger.log(`Sending LCP span (${lcpValue})`);
59+
DEBUG_BUILD && debug.log(`Sending LCP span (${lcpValue})`);
6060

6161
const startTime = msToSec((browserPerformanceTimeOrigin() || 0) + (entry?.startTime || 0));
6262
const routeName = getCurrentScope().getScopeData().transactionName;

0 commit comments

Comments
 (0)