-
public class RiveLogRiveLog allows configuring logging within Rive.
By default, it uses
NoOpLogger, which does nothing. You can set your own logger by assigning an instance ofLoggertoRiveLog.logger. For basic logging, you can useRiveLog.LogcatLoggerto log to Logcat.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceRiveLog.LoggerInterface for logging. Implementations should provide methods for different log levels.
Users can implement this interface to use a logging library, such as Timber.
The
msgparameter 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 classRiveLog.LogcatLoggerImplementation that logs to Logcat with lazy
msg()evaluation.public classRiveLog.NoOpLoggerLogger implementation that logs nothing. Used by default.
-
Field Summary
Fields Modifier and Type Field Description private volatile RiveLog.Loggerloggerpublic final static RiveLogINSTANCE
-
Method Summary
Modifier and Type Method Description final static Unitv(String tag, Function0<String> msg)final static Unitd(String tag, Function0<String> msg)final static Uniti(String tag, Function0<String> msg)final static Unitw(String tag, Function0<String> msg)final static Unite(String tag, Throwable t, Function0<String> msg)final RiveLog.LoggergetLogger()The current logging implementation. final UnitsetLogger(RiveLog.Logger logger)The current logging implementation. -
-
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
@Volatileto 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
@Volatileto ensure immediate visibility across threads.
-
-
-
-