-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SDK-2163] Added new BranchLogger class #1346
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1346 +/- ##
==========================================
+ Coverage 50.60% 50.94% +0.34%
==========================================
Files 68 67 -1
Lines 10070 10130 +60
Branches 3862 3798 -64
==========================================
+ Hits 5096 5161 +65
+ Misses 4714 4704 -10
- Partials 260 265 +5 ☔ View full report in Codecov by Sentry. |
sharedInstance = [[BranchLogger alloc] init]; | ||
sharedInstance.loggingEnabled = NO; | ||
sharedInstance.logLevelThreshold = BranchLogLevelDebug; | ||
sharedInstance.includeCallerDetails = YES; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's performance test this prior to setting it to YES by default.
Reference
SDK-2163 -- Replace BNCLog with a simpler class based solution
Summary
This PR introduces a new logging class,
BranchLogger
, designed to replace the existingBNCLog
utility. The goal is to simplify logging within the SDK by providing a clear, straightforward way to log messages at different levels (Debug, Info, Warning, Error), support conditional logging based on the set log level threshold, and provide clients with a log callback.This is phase one of this change which is just creating the new class and implementing it in a few places. Once approved, the next phase will remove the existing
BNCLog
class and replace all of its usage withBranchLogger
.Motivation
The motivation behind this change is to make it easier to log at different levels throughout the SDK and replace the old BNCLog class. Additionally, this change provide clients with new features like enabling logs only above a certain level and the ability to receive logs via a callbacks instead.
Type Of Change
Testing Instructions
[[Branch getInstance] enableLogging]
or the new[[Branch getInstance] enableLoggingAtLevel:BranchLogLevelVerbose]
;cc @BranchMetrics/saas-sdk-devs for visibility.