Skip to content

Commit

Permalink
feat(replay): Remove unused debug statements (#8167)
Browse files Browse the repository at this point in the history
These debug statements are not really providing value, removing them...
  • Loading branch information
billyvg committed May 25, 2023
1 parent b9a9390 commit 3f31b3d
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions packages/replay/src/coreHandlers/handleGlobalEvent.ts
@@ -1,4 +1,3 @@
import { addBreadcrumb } from '@sentry/core';
import type { Event, EventHint } from '@sentry/types';
import { logger } from '@sentry/utils';

Expand Down Expand Up @@ -50,13 +49,6 @@ export function handleGlobalEventListener(
event.tags = { ...event.tags, replayId: replay.getSessionId() };
}

if (__DEBUG_BUILD__ && replay.getOptions()._experiments.traceInternals && isErrorEvent(event)) {
const exc = getEventExceptionValues(event);
addInternalBreadcrumb({
message: `Tagging event (${event.event_id}) - ${event.message} - ${exc.type}: ${exc.value}`,
});
}

// In cases where a custom client is used that does not support the new hooks (yet),
// we manually call this hook method here
if (afterSendHandler) {
Expand All @@ -67,22 +59,3 @@ export function handleGlobalEventListener(
return event;
};
}

function addInternalBreadcrumb(arg: Parameters<typeof addBreadcrumb>[0]): void {
const { category, level, message, ...rest } = arg;

addBreadcrumb({
category: category || 'console',
level: level || 'debug',
message: `[debug]: ${message}`,
...rest,
});
}

function getEventExceptionValues(event: Event): { type: string; value: string } {
return {
type: 'Unknown',
value: 'n/a',
...(event.exception && event.exception.values && event.exception.values[0]),
};
}

0 comments on commit 3f31b3d

Please sign in to comment.