Skip to content

Making setOutput in SentrySDKLog.swift public to make it possible to forward logs to the JS console#7444

Merged
alwx merged 12 commits intomainfrom
alwx/fix/set_output
Feb 24, 2026
Merged

Making setOutput in SentrySDKLog.swift public to make it possible to forward logs to the JS console#7444
alwx merged 12 commits intomainfrom
alwx/fix/set_output

Conversation

@alwx
Copy link
Copy Markdown
Contributor

@alwx alwx commented Feb 12, 2026

📜 Description

This PR adds one tiny change to the codebase — it makes setOutput in SentrySDKLog.swift public.
That's required by RN SDK (and probably other hybrid SDKs as well) in order to support log forwarding — the ability to see native logs in JS console: getsentry/sentry-react-native#5622

(there are also some formatting changes done here but they were done automatically after I ran make format)

📝 Checklist

You have to check all boxes before merging:

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 12, 2026

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Bug Fixes 🐛

  • Don't finish network spans for suspended URL session tasks by denrase in #7471
  • Resolve data race crash in monitorCachedData by denrase in #7423

Internal Changes 🔧

Deps

  • Bump actions/checkout from 6.0.1 to 6.0.2 by dependabot in #7497
  • Bump getsentry/craft from 2.21.4 to 2.21.7 by dependabot in #7499
  • Bump getsentry/craft/.github/workflows/changelog-preview.yml from 2.21.4 to 2.21.7 by dependabot in #7498
  • Bump nokogiri from 1.19.0 to 1.19.1 by dependabot in #7489

Other

  • (logs) Move span_id from attributes to top-level field by philprime in #7467
  • Bump xcodebuildmcp to 2.0.7 by philipphofmann in #7504
  • Replace DefaultSentryMetricsTelemetryBuffer with DefaultTelemetryBuffer by philipphofmann in #7485

Other

  • Making setOutput in SentrySDKLog.swift public to make it possible to forward logs to the JS console by alwx in #7444

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 12, 2026

Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Features

- Making `setOutput` in `SentrySDKLog.swift` public to make it possible to forward logs to the JS console ([#7444](https://github.com/getsentry/sentry-cocoa/pull/7444))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against 5f6059d

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.245%. Comparing base (ad4704b) to head (5f6059d).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
Sources/Sentry/PrivateSentrySDKOnly.m 0.000% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #7444       +/-   ##
=============================================
- Coverage   85.275%   85.245%   -0.030%     
=============================================
  Files          479       479               
  Lines        28579     28582        +3     
  Branches     12425     12407       -18     
=============================================
- Hits         24371     24365        -6     
- Misses        4162      4171        +9     
  Partials        46        46               
Files with missing lines Coverage Δ
Sources/Swift/Core/Tools/SentrySDKLog.swift 100.000% <100.000%> (ø)
Sources/Sentry/PrivateSentrySDKOnly.m 73.333% <0.000%> (-0.617%) ⬇️

... and 5 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ad4704b...5f6059d. Read the comment docs.

@alwx alwx added the ready-to-merge Use this label to trigger all PR workflows label Feb 12, 2026
Copy link
Copy Markdown
Contributor

@itaybre itaybre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this should be set through https://github.com/getsentry/sentry-cocoa/blob/main/Sources/Sentry/Public/PrivateSentrySDKOnly.h

@alwx alwx requested a review from itaybre February 16, 2026 08:34
@alwx
Copy link
Copy Markdown
Contributor Author

alwx commented Feb 16, 2026

@itaybre done, check it out again

@alwx alwx force-pushed the alwx/fix/set_output branch from 251c364 to fc7a64f Compare February 16, 2026 09:20
Copy link
Copy Markdown
Member

@philprime philprime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I think you need to run make generate-public-api to regenerate the sdk_api.json

@alwx alwx enabled auto-merge (squash) February 23, 2026 10:27
Comment thread Sources/Sentry/Public/PrivateSentrySDKOnly.h
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment thread Sources/Swift/Core/Tools/SentrySDKLog.swift Outdated
@alwx alwx merged commit 16b3235 into main Feb 24, 2026
205 of 206 checks passed
@alwx alwx deleted the alwx/fix/set_output branch February 24, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Use this label to trigger all PR workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants