Skip to content

Conversation

@denrase
Copy link
Collaborator

@denrase denrase commented Jun 20, 2025

#skip-changelog

📜 Description

  • Adds SentryLog, SentryLog.Attribute and SentryLog.Level classes
  • Implements Serialization/Deserialization

💡 Motivation and Context

Preparation for structured logs.

Relates to #5122

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

@github-actions
Copy link
Contributor

github-actions bot commented Jun 20, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 124d3e3

@denrase
Copy link
Collaborator Author

denrase commented Jun 20, 2025

I'm not sure regarding naming of the "old" SentryLog classes. Another possibility would be SentryLogging. Would not go with SentryLogger, as the new Logs API already has Sentry.logger.warn(...) as naming, so I'd like to leave this for now.

As far as i could tell we use it to print to console, so maybe calling it SentryConsoleLog would also be a potential candidate.

@denrase denrase marked this pull request as ready for review June 20, 2025 16:34
denrase added 5 commits June 24, 2025 10:30
# Conflicts:
#	Sentry.xcodeproj/project.pbxproj
#	Sources/Sentry/SentryHttpTransport.m
#	Sources/Sentry/SentryNSURLRequest.m
#	Sources/Sentry/SentryNSURLRequestBuilder.m
#	Sources/Sentry/SentrySpotlightTransport.m
#	Tests/SentryTests/Helper/SentryLogSwift.swift
#	Tests/SentryTests/Helper/SentryLogSwiftTests.swift
#	Tests/SentryTests/Integrations/SentryBaseIntegrationTests.swift
#	Tests/SentryTests/SentryCrash/SentryCrashStackCursorSelfThreadTests.swift
#	Tests/SentryTests/SentrySDKTests.swift
Base automatically changed from chore/rename-sentry-log-classes to main June 26, 2025 15:51
denrase added 2 commits June 26, 2025 18:01
# Conflicts:
#	Sentry.xcodeproj/project.pbxproj
#	Sources/Sentry/Profiling/SentryContinuousProfiler.mm
#	Sources/Sentry/Profiling/SentryTraceProfiler.mm
#	Sources/Sentry/SentryANRTrackerV1.m
#	Sources/Sentry/SentryInstallation.m
#	Sources/Sentry/SentryPerformanceTrackingIntegration.m
#	Sources/Sentry/SentrySubClassFinder.m
#	Sources/Sentry/SentryUIApplication.m
#	Sources/Sentry/SentryViewHierarchyProvider.m
#	Sources/Swift/Integrations/SessionReplay/SentryOnDemandReplay.swift
#	Sources/Swift/Integrations/SessionReplay/SentrySessionReplay.swift
#	Sources/Swift/Integrations/WatchdogTerminations/Processors/SentryWatchdogTerminationContextProcessor.swift
#	Sources/Swift/Persistence/SentryScopeContextPersistentStore.swift
#	Tests/SentryTests/Helper/SentrySDKLogTests.swift
#	Tests/SentryTests/Protocol/Codable/SentryCodableTests.swift
@denrase denrase changed the title [Structured Logging] Models [Structured Logging] Add SentryLog Models Jun 26, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jun 27, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1228.08 ms 1253.58 ms 25.50 ms
Size 23.74 KiB 872.51 KiB 848.77 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
55f739c 1226.06 ms 1248.78 ms 22.71 ms
f97a070 1218.88 ms 1253.12 ms 34.24 ms
acac774 1217.76 ms 1253.29 ms 35.52 ms
b0e13a7 1227.71 ms 1245.88 ms 18.16 ms
db9572a 1212.61 ms 1237.73 ms 25.13 ms
35c962f 1207.61 ms 1235.90 ms 28.29 ms
db9572a 1200.27 ms 1234.80 ms 34.53 ms
b13e93a 1236.24 ms 1247.33 ms 11.08 ms
8047b99 1226.37 ms 1246.63 ms 20.26 ms
8ea5293 1242.70 ms 1262.25 ms 19.55 ms

App size

Revision Plain With Sentry Diff
55f739c 23.75 KiB 858.73 KiB 834.98 KiB
f97a070 23.75 KiB 858.68 KiB 834.93 KiB
acac774 23.75 KiB 866.51 KiB 842.76 KiB
b0e13a7 23.75 KiB 860.98 KiB 837.23 KiB
db9572a 23.75 KiB 858.65 KiB 834.90 KiB
35c962f 23.75 KiB 854.77 KiB 831.02 KiB
db9572a 23.75 KiB 858.69 KiB 834.93 KiB
b13e93a 23.75 KiB 855.37 KiB 831.62 KiB
8047b99 23.75 KiB 855.37 KiB 831.62 KiB
8ea5293 23.75 KiB 852.24 KiB 828.49 KiB

Previous results on branch: feat/structured-logs-models

Startup times

Revision Plain With Sentry Diff
152587f 1232.74 ms 1247.65 ms 14.91 ms

App size

Revision Plain With Sentry Diff
152587f 23.74 KiB 872.45 KiB 848.71 KiB

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

Thanks for doing this. I added a few comments.

@denrase denrase requested a review from philipphofmann July 1, 2025 12:22
Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

LGTM, with one open comment (#5441 (comment)) that I have no strong opinion about. Thank you @denrase

@denrase denrase merged commit 51603df into main Jul 1, 2025
238 of 243 checks passed
@denrase denrase deleted the feat/structured-logs-models branch July 1, 2025 13:54
@philprime
Copy link
Member

Thank you @denrase for implementing our feedback 👍

philipsawyerdd added a commit to justin-doordash/sentry-cocoa that referenced this pull request Sep 25, 2025
philipsawyerdd added a commit to justin-doordash/sentry-cocoa that referenced this pull request Sep 25, 2025
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.

5 participants