Skip to content

Conversation

@denrase
Copy link
Collaborator

@denrase denrase commented Dec 1, 2025

#skip-changelog

📜 Description

  • Adds the SentrySwiftLog integration to the integrations/logs/sentry-swift-log folder
  • Skipping changelog as this is not available to users through this repo

💡 Motivation and Context

Closes #5372
Relates to #6902

💚 How did you test it?

  • Runs pure swift tests against the current Package.swift version
  • This loads pre-build artefacts, so we always test against already released versions.
  • Should we rather test against current source?

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

@codecov
Copy link

codecov bot commented Dec 3, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
3993 1 3992 24
View the top 1 failed test(s) by shortest run time
SentryTests.SentrySDKLogTests::testLevelNone_PrintsEverythingExceptNone
Stack Traces | 0s run time
[Sentry] [debug] [978307200.1234] [SentryReachability:121] SentryPathUpdateHandler called with path status: .../SentryTests/Helper/SentrySDKLogTests.swift:79 - XCTAssertEqual failed: ("["[Sentry] [fatal] [978307200.1234] 0", "[Sentry] [error] [978307200.1234] 1", "[Sentry] [warning] [978307200.1234] 2", "[Sentry] [info] [978307200.1234] 3", "[Sentry] [debug] [978307200.1234] 4"]") is not equal to ("["[Sentry] [fatal] [978307200.1234] 0", "[Sentry] [error] [978307200.1234] 1", "[Sentry] [warning] [978307200.1234] 2", "[Sentry] [debug] [978307200.1234] [SentryDelayedFramesTracker:151] Not calculating frames delay because frames tracker isn\'t running.", "[Sentry] [info] [978307200.1234] 3", "[Sentry] [debug] [978307200.1234] 4"]")

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

SentrySDK.start { options in
options.dsn = "https://[email protected]/123456"
options.enableLogs = true
options.beforeSendLog = { [weak self] log in
Copy link
Collaborator Author

@denrase denrase Dec 3, 2025

Choose a reason for hiding this comment

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

Just use public SDK API for testing. That way we don't need any kind of test helpers from the main repo, keeping it completely separate and easily transferable to a downstream repo.

@denrase denrase added the ready-to-merge Use this label to trigger all PR workflows label Dec 3, 2025
@denrase denrase marked this pull request as ready for review December 3, 2025 10:45
@denrase denrase changed the title Add SentrySwiftLog Package Log Integrations: Add SentrySwiftLog Package Dec 3, 2025
- name: Run CI Diagnostics
if: failure()
run: ./scripts/ci-diagnostics.sh

Copy link

Choose a reason for hiding this comment

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

Bug: New test job missing from required-check dependencies

The new swiftlog-integration-unit-tests job is not included in the unit-tests-required-check job's needs array. Since unit-tests-required-check is the required status check that gates merging, failures in the swiftlog integration tests won't block the PR from merging. The job runs but its result is never validated by the required check.

Fix in Cursor Fix in Web

Copy link
Member

Choose a reason for hiding this comment

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

This is relevant!

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1228.80 ms 1260.73 ms 31.93 ms
Size 24.14 KiB 1.02 MiB 1019.58 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
7908e84 1224.33 ms 1246.39 ms 22.06 ms
9c75c11 1228.42 ms 1262.81 ms 34.39 ms
795dd39 1216.88 ms 1245.47 ms 28.59 ms
ea12acf 1217.67 ms 1252.69 ms 35.03 ms
fae97e5 1229.20 ms 1256.27 ms 27.06 ms
1bf44b4 1238.14 ms 1275.45 ms 37.31 ms
9389467 1218.62 ms 1244.86 ms 26.24 ms
781f560 1232.83 ms 1263.56 ms 30.73 ms
ea3f7b6 1228.14 ms 1258.71 ms 30.57 ms
102cf89 1218.31 ms 1239.78 ms 21.47 ms

App size

Revision Plain With Sentry Diff
7908e84 23.74 KiB 872.75 KiB 849.00 KiB
9c75c11 23.74 KiB 1022.95 KiB 999.20 KiB
795dd39 23.75 KiB 908.16 KiB 884.41 KiB
ea12acf 23.75 KiB 974.89 KiB 951.14 KiB
fae97e5 23.75 KiB 912.37 KiB 888.62 KiB
1bf44b4 23.75 KiB 1021.20 KiB 997.45 KiB
9389467 23.75 KiB 866.51 KiB 842.76 KiB
781f560 23.75 KiB 1.02 MiB 1016.46 KiB
ea3f7b6 23.75 KiB 1.01 MiB 1008.77 KiB
102cf89 23.74 KiB 891.02 KiB 867.27 KiB

Previous results on branch: feat/add-swift-log-integration

Startup times

Revision Plain With Sentry Diff
b78f1c7 1213.30 ms 1242.79 ms 29.49 ms
5c126cf 1210.42 ms 1237.67 ms 27.25 ms
ec6df71 1210.16 ms 1240.33 ms 30.16 ms
587a9b5 1213.80 ms 1250.94 ms 37.14 ms
e39cfe2 1196.87 ms 1216.73 ms 19.87 ms
b06a366 1212.46 ms 1242.20 ms 29.74 ms

App size

Revision Plain With Sentry Diff
b78f1c7 24.14 KiB 1.02 MiB 1019.59 KiB
5c126cf 24.14 KiB 1.02 MiB 1019.58 KiB
ec6df71 24.14 KiB 1.02 MiB 1019.40 KiB
587a9b5 24.14 KiB 1.02 MiB 1016.89 KiB
e39cfe2 24.14 KiB 1.02 MiB 1016.90 KiB
b06a366 24.14 KiB 1.02 MiB 1016.90 KiB

device: "Apple TV"
scheme: "Sentry"

swiftlog-integration-unit-tests:
Copy link
Member

Choose a reason for hiding this comment

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

m: We should consider adding a new workflow file for integrations separate to the main SDK tests, and to not further extend it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@itaybre started working on a shared workflow we can use for integrations in #6945 which we can use when ready.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added a comment to replace this once #6945 is ready.

- name: Run CI Diagnostics
if: failure()
run: ./scripts/ci-diagnostics.sh

Copy link
Member

Choose a reason for hiding this comment

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

This is relevant!


var attributes: [String: Any] = [:]
attributes["sentry.origin"] = "auto.logging.swift-log"
attributes["swift-log.level"] = level.rawValue
Copy link
Member

Choose a reason for hiding this comment

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

m: Is the attribute namespacing standardized? Would it make sense to prefix with integration.?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Could not find anything regarding additional attributes. My thinking was if we have sentry.x where sentry is the source, we should use swift-log.x where swift-log is the source of the data.

@github-actions
Copy link
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • .github/file-filters.yml

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.

Log Integration: swift-log

3 participants