Skip to content

feat: add RiveLogger with configurable JS handler and deprecation warnings#201

Draft
mfazekas wants to merge 8 commits intofeat/rive-ios-experimentalfrom
feat/rive-logger
Draft

feat: add RiveLogger with configurable JS handler and deprecation warnings#201
mfazekas wants to merge 8 commits intofeat/rive-ios-experimentalfrom
feat/rive-logger

Conversation

@mfazekas
Copy link
Copy Markdown
Collaborator

@mfazekas mfazekas commented Mar 31, 2026

Summary

  • Adds RiveLog — a general-purpose logging system that surfaces native logs to JS via a configurable handler
  • Default handler uses console.error/warn/log so logs show in the RN console out of the box
  • On both platforms, hooks into the Rive SDK's pluggable RiveLog.Logger to unify C++ runtime logs (state machine, artboard, command queue diagnostics) through the JS handler
  • Adds DeprecationWarning utility that emits once-per-session warnings when deprecated blocking methods are called

Test plan

  • Build exerciser on iOS + Android
  • Call a deprecated method (e.g. riveFile.viewModelByName(...)) — verify warning in RN console
  • Call same method again — verify no duplicate warning
  • RiveLog.setHandler(() => {}) — verify all logs suppressed
  • RiveLog.resetHandler() — verify back to default console output
  • Verify onError prop on RiveView still works independently

…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.
@mfazekas mfazekas marked this pull request as draft March 31, 2026 16:12
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant