analytics-android
analytics-android copied to clipboard
Feature request: Custom logger
This feature request is to allow passing a custom logger implementation to the Segment SDK. This will allow users to log errors somewhere different from the Logcat.
The motivation behind this request is that we have been investigating the source of some data discrepancies between Segment and our Database for a few months. We had to clone the SDK and modify it to send errors to Crashlytics, and that's how we found out that the API was returning us a lot of HTTP 400 errors because of https://github.com/segmentio/analytics-android/pull/755. Even though the errors in the log don't explicitly say what the error is, they would help us a lot to know that we broke something in the future.
The implementation should be fairly simple because the Analytics constructor already receives the logger. It would need to be optionally provided by the Analytics.Builder.
Does this feature make sense to you? Are you open to PRs for it?
Custom logger definitely makes sense, although I do not think we will be working on this feature any time soon, unless priorities change. We are definitely open to PRs for it and definitely encourage community contributions 😄