feat: add RiveLogger with configurable JS handler and deprecation warnings#201
Draft
mfazekas wants to merge 8 commits intofeat/rive-ios-experimentalfrom
Draft
feat: add RiveLogger with configurable JS handler and deprecation warnings#201mfazekas wants to merge 8 commits intofeat/rive-ios-experimentalfrom
mfazekas wants to merge 8 commits intofeat/rive-ios-experimentalfrom
Conversation
…nings Adds a general-purpose logging system (RiveLogger) that surfaces native logs to JS. By default logs show in the RN console via console.error/warn/log. Users can set a custom handler to filter, suppress, or forward logs (e.g. to Sentry). On Android, Rive C++ runtime logs are also unified through RiveLog. Deprecated blocking methods now emit once-per-session warnings via the DeprecationWarning utility.
…logger Renames the exported namespace from RiveLogger to RiveLog to match the native SDK naming convention. Implements RiveRuntime.RiveLog.Logger on iOS to unify C++ runtime logs through our bridge logging system (parity with Android's RiveErrorLogger).
…d locations These utilities must be accessible to both legacy and new backends. iOS: ios/new/ → ios/ (shared root). Android: src/new/ → src/main/ (shared). RiveRuntimeLogger stays in ios/new/ since it depends on the experimental SDK.
…ions RiveLog.Tag doesn't have a .category property in the installed SDK version (6.18.0) — use a local switch to map tag cases to strings. Also wrap deprecation assertions in waitFor to handle async Nitro callback delivery on Android.
Legacy backend doesn't have DeprecationWarning.warn() calls in its deprecated methods, so deprecation-specific tests are skipped when running with the legacy runtime.
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
RiveLog— a general-purpose logging system that surfaces native logs to JS via a configurable handlerconsole.error/warn/logso logs show in the RN console out of the boxRiveLog.Loggerto unify C++ runtime logs (state machine, artboard, command queue diagnostics) through the JS handlerDeprecationWarningutility that emits once-per-session warnings when deprecated blocking methods are calledTest plan
riveFile.viewModelByName(...)) — verify warning in RN consoleRiveLog.setHandler(() => {})— verify all logs suppressedRiveLog.resetHandler()— verify back to default console outputonErrorprop on RiveView still works independently