Logger
Klyx provides a full logging system with log levels, contextual information, and structured output. Access it through the plugin’s logger or the globalLogger.
Log levels
LogContext
All logging calls accept an optionalLogContext that provides tagged and tagged-with-plugin metadata:
LogContext is a marker interface. KlyxPlugin implements LogContext, so logging inside a plugin method automatically uses the plugin’s name as the tag and its ID as the source. Use NoLogContext for code not associated with a plugin.
Logger extensions
TheLogger service is accessed through the plugin’s dependency injection. Use the plugin() delegate or rememberLogger() in composables:
Structured logging
LogEntry and LogLevel
rememberLogger()
A composable that remembers theLogger from the current LocalApp:
Resources
Plugin access to Android resources is throughPluginContext:
Resource access with withResources
ThewithResources composable wraps content with the plugin’s LocalContext, making resource-backed Compose APIs resolve against the plugin’s own resources:
Context receiver extensions
Extensions provide convenience functions that use Kotlin context receivers. These are available when the plugin instance is in scope.UI effects
Lifecycle helpers
Plugin context
Toast host state
Navigator
TheNavigator service handles screen navigation: