feat(logger): [SDK-4835] gate otel-vs-logger switch on SDK_CUSTOM_LOGGING flag#2688
Merged
Merged
Conversation
2 tasks
Contributor
📊 Diff Coverage ReportDiff Coverage Report (Changed Lines Only)Gate: aggregate coverage on changed executable lines must be ≥ 80% (JaCoCo line data for lines touched in the diff). Changed Files Coverage
Overall (aggregate gate)3/9 touched executable lines covered (33.3% — requires ≥ 80%) Per-file detail (informational; gate is aggregate above):
❌ Coverage Check FailedAggregate coverage on touched lines is 33.3% (minimum 80%). |
abdulraqeeb33
force-pushed
the
feat/SDK-4835-custom-logging-feature-flag
branch
2 times, most recently
from
July 23, 2026 20:17
38d85c3 to
4c503a1
Compare
…GING flag Replace the hardcoded LoggerModuleSwitch.USE_LOGGER_MODULE boolean with a remote-config-driven decision. Add the SDK_CUSTOM_LOGGING feature flag (APP_STARTUP activation) and resolve it during early init directly from the cached config in SharedPreferences via OtelIdResolver.resolveCustomLoggingEnabled(), so toggling the flag takes effect on the next app start rather than mid-session. Add unit tests covering resolveCustomLoggingEnabled() (present/absent, case-insensitive, empty/missing flags, no config, null context, invalid JSON), the LoggerModuleSwitch.useLoggerModule() end-to-end read, and the SDK_CUSTOM_LOGGING enum key + activation mode. Co-authored-by: Cursor <cursoragent@cursor.com>
abdulraqeeb33
force-pushed
the
feat/SDK-4835-custom-logging-feature-flag
branch
from
July 24, 2026 05:39
4c503a1 to
f791338
Compare
arcoleo
approved these changes
Jul 24, 2026
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
Replaces the hardcoded
LoggerModuleSwitch.USE_LOGGER_MODULEboolean with a remote-config-driven decision so the new multiplatformloggermodule can be enabled/disabled from the backend instead of via a code change.SDK_CUSTOM_LOGGINGfeature flag (sdk_custom_logging,FeatureActivationMode.APP_STARTUP).LoggerModuleSwitch.useLoggerModule(context)now resolves the flag during early init by reading the cached config straight fromSharedPreferencesviaOtelIdResolver.resolveCustomLoggingEnabled()— before service bootstrap /FeatureManagerexist.OneSignalImp(lifecycle manager selection) andOneSignalCrashUploaderWrapper(crash uploader selection).Why read from prefs directly?
The otel-vs-logger choice is made at the very start of init, before the IoC container and
FeatureManagerare ready.OtelIdResolveralready reads other cached values (appId, log level, ids) from prefs on this cold-start path, so the flag resolution follows the same pattern. Matching is case-insensitive to mirrorFeatureManager's canonical keys.Tests
New/updated unit tests (all passing via
:OneSignal:core:testDebugUnitTest):OtelIdResolverTest—resolveCustomLoggingEnabled(): flag present, case-insensitive, present-among-others, absent, empty array, missing field, no config, null context, invalid JSON.LoggerModuleSwitchTest(new) —useLoggerModule()end-to-end: reads cached flag from prefs → true/false, and false when no config.FeatureFlagTests— assertsSDK_CUSTOM_LOGGINGkey +APP_STARTUPactivation mode.Notes
feat/SDK-4835-kmp-logger-module(this stacks on the logger module work).gradle.propertiespublish toggle was intentionally left out of this PR.Test plan
sdk_custom_loggingremotely routes observability through theloggermodule on next launchotelmoduleMade with Cursor