Add OSLog support to SFSDKLogger #271
Merged
bbirman merged 2 commits intoforcedotcom:devfrom Oct 21, 2025
Merged
Conversation
|
Thanks for the contribution! Before we can merge this, we need @TheAlmightyBob to sign the Salesforce Inc. Contributor License Agreement. |
Contributor
Author
|
I tried to sign the CLA and it returned an error. If I try again it says I already signed... |
- New "useOSLog" class property on SFSDKLogger. Defaults to "NO" to preserve existing behavior. Must be set prior to creating logger instances. - If enabled, console logs will use OSLog to provide distinct log lines with metadata instead of the previous plain text logging method
…without OSLog enabled
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #271 +/- ##
==========================================
+ Coverage 61.39% 63.08% +1.68%
==========================================
Files 21 21
Lines 1816 1834 +18
==========================================
+ Hits 1115 1157 +42
+ Misses 701 677 -24
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
bbirman
approved these changes
Oct 21, 2025
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.
Summary
OSLog provides more modern console logging than the existing mechanism used by
SFSDKLogger, with distinct log entries, status coloring, and filterable metadata.The underlying
CocoaLumberjackalready supports it (in fact, it actually logs a warning if you're still using the old logger), so this PR simply provides the option to enable it. It still defaults to the existing behavior to be safe.Details
useOSLogclass property onSFSDKLogger. Defaults toNO. Must be set prior to creating logger instances.SalesforceFileLoggerTestAppto log a few messages with/without OSLog