Skip to content

Commit f595c94

Browse files
committed
Fix the debug log.
1 parent be8a668 commit f595c94

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react/src/reactrouter-compat-utils/instrumentation.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -730,12 +730,12 @@ export function handleNavigation(opts: {
730730
!transactionNameHasWildcard(name);
731731

732732
if (shouldUpdate) {
733+
const oldName = trackedNav.routeName;
733734
trackedNav.span.updateName(name);
734735
trackedNav.span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, source as 'route' | 'url' | 'custom');
735736
// Update the tracked route name so future checks use the new name
736737
trackedNav.routeName = name;
737-
DEBUG_BUILD &&
738-
debug.log(`[Tracing] Updated navigation span name from "${trackedNav.routeName}" to "${name}"`);
738+
DEBUG_BUILD && debug.log(`[Tracing] Updated navigation span name from "${oldName}" to "${name}"`);
739739
}
740740
return; // Skip - duplicate (same pathname, span still active)
741741
}

0 commit comments

Comments
 (0)