object Logger


Logger for Subspace Compose. This is a simple wrapper around Log.v that is only enabled if the androidx.xr.compose.platform.Logger metadata flag is set in the AndroidManifest.xml.

Summary

Public functions

Unit
init(context: Context)

Initializes the logger.

Unit
log(tag: String, messageGenerator: () -> String)

Logs a message to the logcat if debugging was enabled in the init method.

Public functions

init

Added in 1.0.0-alpha01
fun init(context: Context): Unit

Initializes the logger. This method expects android:name="androidx.xr.compose.platform.Logger" to be set in a metadata tag in the AndroidManifest.xml. Typically the value of this key is set to false but can be set to true to enable debug logging. For example:

Parameters
context: Context

The application context for the current application.

log

Added in 1.0.0-alpha01
fun log(tag: String, messageGenerator: () -> String): Unit

Logs a message to the logcat if debugging was enabled in the init method.

Parameters
tag: String

The tag to use for the log message.

messageGenerator: () -> String

This generates the message to log.