Skip to content

Conversation

@denrase
Copy link
Collaborator

@denrase denrase commented Oct 23, 2025

📜 Description

  • Adds captureLog methods to both Hub and Scope
  • Moves attributes enrichment of logs into batcher, so that hub/scope calls also get them.
  • Provides additional workarounds for circular issues regarding Logs an ObjC/Swift
  • Adds public initializers to SentryLog, so users can actually create them for hub/client method usage.

💡 Motivation and Context

Closes #6503

💚 How did you test it?

Unit tests

📝 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.

@denrase
Copy link
Collaborator Author

denrase commented Oct 23, 2025

@philipphofmann Hacked this together. Works locally. If there are no other blockers, everything should work out without breaking existing public API.

@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.418%. Comparing base (707c222) to head (ca30a2d).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #6518       +/-   ##
=============================================
+ Coverage   85.899%   86.418%   +0.518%     
=============================================
  Files          451       451               
  Lines        27482     27494       +12     
  Branches     11970     11969        -1     
=============================================
+ Hits         23607     23760      +153     
+ Misses        3826      3691      -135     
+ Partials        49        43        -6     
Files with missing lines Coverage Δ
SentryTestUtils/TestClient.swift 84.905% <100.000%> (ø)
Sources/Sentry/SentryClient.m 97.426% <100.000%> (-1.645%) ⬇️
Sources/Sentry/SentryHub.m 96.842% <100.000%> (+0.033%) ⬆️
Sources/Swift/Helper/SentrySDK.swift 85.576% <100.000%> (-1.924%) ⬇️
Sources/Swift/Protocol/SentryLog.swift 100.000% <100.000%> (ø)
Sources/Swift/Tools/SentryLogBatcher.swift 99.115% <100.000%> (+0.653%) ⬆️
Sources/Swift/Tools/SentryLogger.swift 100.000% <100.000%> (+0.813%) ⬆️

... and 50 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 707c222...ca30a2d. Read the comment docs.

@denrase denrase changed the title Logs: Hub and Client APIs Structured Logs: Add captureLog to Hub and Client Oct 24, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 24, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1217.41 ms 1240.59 ms 23.18 ms
Size 23.75 KiB 1.01 MiB 1006.79 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
afaa522 1234.71 ms 1256.19 ms 21.48 ms
670b474 1225.33 ms 1259.59 ms 34.26 ms
162cd7f 1230.59 ms 1256.76 ms 26.16 ms
9add417 1224.33 ms 1243.06 ms 18.73 ms
4c719e2 1206.92 ms 1237.45 ms 30.53 ms
ac4739e 1236.55 ms 1258.89 ms 22.34 ms
3133d0e 1237.86 ms 1262.87 ms 25.01 ms
51f74d7 1236.31 ms 1247.43 ms 11.12 ms
85a741b 1217.02 ms 1239.27 ms 22.25 ms
2c59847 1216.15 ms 1253.80 ms 37.65 ms

App size

Revision Plain With Sentry Diff
afaa522 23.74 KiB 996.91 KiB 973.17 KiB
670b474 23.75 KiB 974.89 KiB 951.14 KiB
162cd7f 23.75 KiB 908.39 KiB 884.64 KiB
9add417 23.75 KiB 908.40 KiB 884.65 KiB
4c719e2 23.75 KiB 912.77 KiB 889.02 KiB
ac4739e 23.75 KiB 872.67 KiB 848.92 KiB
3133d0e 23.74 KiB 976.79 KiB 953.04 KiB
51f74d7 23.74 KiB 874.08 KiB 850.34 KiB
85a741b 23.75 KiB 959.44 KiB 935.69 KiB
2c59847 23.75 KiB 1.00 MiB 1005.08 KiB

Previous results on branch: denrase/logs-in-hub-and-client

Startup times

Revision Plain With Sentry Diff
9df70d3 1228.40 ms 1262.55 ms 34.16 ms

App size

Revision Plain With Sentry Diff
9df70d3 23.75 KiB 1.01 MiB 1006.51 KiB

@denrase denrase marked this pull request as ready for review October 24, 2025 14:22
cursor[bot]

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logs: Hub and Client APIs

1 participant