SDK-6010: Auto-sync Flutter NDLogger level from Core SDK debug level - #78
Merged
CTLalit merged 1 commit intoAug 13, 2026
Conversation
The Flutter SDK's NDLogger ignored the host Core SDK's configured debug level — NDLogger.syncFromCoreSdk existed but nothing called it. Align Flutter with the shipped Android/iOS CleverTapAutoWire behaviour (SDK-5860). - NativeDisplayBridge.syncLogLevelFromCoreSdk(): reads the Core debug level over the platform channel (new getCoreDebugLevel method) and forwards it to NDLogger.syncFromCoreSdk. No-op once the client called setLogLevel (client-wins via NDLogger.explicitlySet); graceful no-op when no bridge / Core SDK is wired (null or PlatformException leaves the level intact). - Lazily triggered once per app run from the first fetchConfig (fire-and-forget so config fetch never blocks); also public so the host can call it right after wiring. - Native plugins: NativeDisplayPluginBridge gains getCoreDebugLevel(): Int? (Android, CleverTapAPI.getDebugLevel()) / coreDebugLevel() -> NSNumber? (iOS, KVC debugLevel). iOS handles the arg-less method before the args guard. - NDLogger.resetForTest() (@VisibleForTesting) for test isolation of the process-global logger state; no change to syncFromCoreSdk/setLevel logic. - Tests: NDLogLevel.fromInt mapping (incl. unknown→DEBUG) + syncFromCoreSdk semantics + client-wins + null/exception no-op bridge cases. flutter analyze clean; flutter test 192/192 pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Aug 10, 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.
Jira: SDK-6010 — epic SDK-5820
Stack (bottom → top):
Base of stack:
feat/SDK-5821-flutter-models(PR #38 →main).Stack created with GitHub Stacks CLI • Give Feedback 💬