fix(core): Use the debug logger, not the Logs API, for SDK diagnostics - #6585
Merged
Conversation
`logger` from `@sentry/core` is the structured Logs API: every call captures a log record and ships it to the user's project. `debug` is the internal debug logger, printed to the console only when `debug: true`. Ten internal diagnostics were written against `logger`, so an SDK-internal failure became a billable log event in the user's project and could not be silenced. The eight TurboModule ones are the worst case. They sit in the wrap hot path, one per failed call, and capturing a log goes through the wrapped `RNSentry.captureEnvelope` — a failure there logs, which captures, which calls the failing method again. `scopeSync.ts` imported `logger` from `@sentry/react`, which does not re-export `debug`, so that one moves to `@sentry/core`.
Contributor
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
Contributor
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📢 Type of change
📜 Description
loggerfrom@sentry/coreis the structured Logs API — every call captures a log record and ships it to the user's project.debugis the internal debug logger, printed to the console only underdebug: true. Ten internal diagnostics were written againstlogger, so an SDK-internal failure turned into a billable log event the user cannot silence.Switched to
debugin multiple Turbo Modules related files.💡 Motivation and Context
Follow-up to #6561 (comment), agreed with @lucas-zimerman to do separately. The
loggercalls predate #6561.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
tools/sentryOptionsSerializer.ts(7 calls) as described above.