SharedLogFlow
A shared flow of log events, which can be assigned as a Sink.
It will emit Events into the flow when log is called.
Example
class Manager {
enum class Component : Log.Category {
A, B, C
}
var logger: Log.Sink<Component>? = Log.Sink.Null
}
val m = Manager()
m.logger = Log.Sink.Flow().also { flow ->
flow
.onEach { db.save(it) }
.launchIn(scope)
}Content copied to clipboard