Add result builders to `MultiLogger` and `MultiTracker`s 👷
Checklist
- [x] I've rebased my changes on top of
master - [x] I've built and run the project to see all new and existing tests pass
- [x] I've followed the Mindera swift style guide
- [x] I've read the Contribution Guidelines
- [x] I've updated the documentation if necessary.
Motivation and Context
Some of our "multiplexer" instances for logging (Log.MultiLogger), analytics (Analytics.MultiTracker) and performance metrics (PerformanceMetrics.MultiTracker) require type erasure on the child elements to which they forward events, causing the setup to be cumbersome and not intuitive.
By leveraging result builders we can make this a bit smoother to users by abstracting/automating the type erasure "dance". Furthermore, it unlocks control flow (e.g. if/else, for ... in, if #available) which allows more advanced setups to be defined directly in the builder.
Description
-
Add result builders to facilitate instantiating certain "multiplexer" instances, most notably the ones that require type erasure:
-
Log.MultiLogger(requires erasing toAnyMetadataLogDestination) -
Analytics.MultiTracker(requires erasing toAnyAnalyticsTracker) -
PerformanceMetrics.MultiTracker(doesn't require erasing)
-
-
Add relevant UTs.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 95.18%. Comparing base (
40b1f63) to head (dfd5bdc).
Additional details and impacted files
@@ Coverage Diff @@
## master #265 +/- ##
==========================================
+ Coverage 95.09% 95.18% +0.08%
==========================================
Files 101 101
Lines 3384 3445 +61
==========================================
+ Hits 3218 3279 +61
Misses 166 166
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.