Relay
Relay is a Sink that forwards logs to another Sink.
This can be used for internal implementations in Emitters to forward logs to the main sink assigned by the application.
Example
class DeviceManager(
val identifier: String,
): Log.IdentifiableEmitter<String> {
var logger: Log.Sink<MyCategory>? = Log.Sink.Null
private val internalComponent = Component(
// Forward logs to the dynamic logger property above
logger = Relay { logger }
)
}Content copied to clipboard
Return
Parameters
sink
A lambda that returns the sink to forward logs to.