- Apple
- Android
The new runtime does not yet include logging, but will be added in the near future.
Copy
Ask AI
RiveLogger.isEnabled = true // Enable logging; false by default
RiveLogger.levels = [.debug] // Filter logs; all by default
RiveLogger.categories = [.viewModel] // Filter categories; all by default
RiveLogger.isVerbose = true // Include verbose logs; false by default
Levels
Logs will be logged at various levels, which are similar to those ofOSLogType . These levels can be used to additionally filter logs to be logged at certain levels only. Available levels are:- Debug: most commonly used, to aid with debugging
- Info: logs that provide additional information
- Default: the default log level; however, many logs are
debuglevel - Error: used when an error occurs
- Fault: used when a critical (fatal) error occurs
Categories
Logs are split by categories; individual portions of the runtime are split into separate logs to support filtering. Available categories are:- State machine: operations that occur within an active state machine, such as receiving events
- Artboard: operations that occur within an active artboard, such as advancing (verbose)
- View model: operations that occur within a loaded
RiveViewModel, such as triggering / setting inputs - Model: operations that occur within a loaded
RiveModel, such as setting state machines / artboards - File: operations that occur within a loaded
RiveFile, such as asset loading - View: operations that occur within a
RiveView, such as player events (play / pause / stop / reset)
Verbose Logs
Certain logs are verbose, meaning they will stream logs consistently. Examples of these logs are view advances, and drawing validation. Verbose logs are disabled by default; see above for how to enable verbose logging.- Compose
- Legacy
The new runtime includes a fine-grained, flexible logging system that allows you to capture logs at various levels (debug, info, warning, error) and redirect them to your preferred logging framework or sink. This is done by implementing the
RiveLog.Logger interface and assigning the global RiveLog.logger property.The library ships with a default implementation that logs to Android Logcat. Enable it with the following:Copy
Ask AI
RiveLog.logger = RiveLog.LogcatLogger()
Fine-grained Logging is not supported in the legacy runtime. We may consider retrofitting more logging capabilities to the legacy runtime in the future, especially if doing so would illuminate a potential source for bugs.