メインコンテンツまでスキップ

Logs

For different purposes it might be important to be able to read all logs from the app and process them as necessary in particular cases. This is an example of how you might do that through UX Framework controller API in your Application:

class MyApplication : Application() {

val applicationScope = CoroutineScope(SupervisorJob() + Dispatchers.Main)

override fun onCreate() {
super.onCreate()

// ... after Dash.init(...)

applicationScope.launch {
Dash.controller.observeLogs().collect { /* LogEvent */ event ->
// Do something with the LogEvent
}
}
}
}
この{Type}は役に立ちましたか?