Package 

Object RiveLog


  • 
    public class RiveLog
    
                        

    RiveLog allows configuring logging within Rive.

    By default, it uses NoOpLogger, which does nothing. You can set your own logger by assigning an instance of Logger to RiveLog.logger. For basic logging, you can use RiveLog.LogcatLogger to log to Logcat.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public interface RiveLog.Logger

      Interface for logging. Implementations should provide methods for different log levels.

      Users can implement this interface to use a logging library, such as Timber.

      The msg parameter is a lambda to allow lazy evaluation of the log message, which can improve performance by avoiding unnecessary string concatenation when the log level is not enabled.

      public final class RiveLog.LogcatLogger

      Implementation that logs to Logcat with lazy msg() evaluation.

      public class RiveLog.NoOpLogger

      Logger implementation that logs nothing. Used by default.

    • Method Detail

      • getLogger

         final RiveLog.Logger getLogger()

        The current logging implementation. Apps can override this to provide their own logging. For example, in your Application's onCreate:

        if (BuildConfig.DEBUG) { RiveLog.logger = RiveLog.LogcatLogger() }

        Marked as @Volatile to ensure immediate visibility across threads.

      • setLogger

         final Unit setLogger(RiveLog.Logger logger)

        The current logging implementation. Apps can override this to provide their own logging. For example, in your Application's onCreate:

        if (BuildConfig.DEBUG) { RiveLog.logger = RiveLog.LogcatLogger() }

        Marked as @Volatile to ensure immediate visibility across threads.