Adds debug logs

This commit is contained in:
ericdecanini 2022-03-08 17:19:11 +01:00
parent 510206aa8a
commit 0892525c84

View file

@ -19,6 +19,7 @@ package org.matrix.android.sdk.internal.session.space
import org.matrix.android.sdk.internal.network.GlobalErrorReceiver
import org.matrix.android.sdk.internal.network.executeRequest
import org.matrix.android.sdk.internal.task.Task
import timber.log.Timber
import javax.inject.Inject
internal interface ResolveSpaceInfoTask : Task<ResolveSpaceInfoTask.Params, SpacesResponse> {
@ -39,10 +40,12 @@ internal class DefaultResolveSpaceInfoTask @Inject constructor(
private lateinit var params: ResolveSpaceInfoTask.Params
override suspend fun execute(params: ResolveSpaceInfoTask.Params): SpacesResponse {
return executeRequest(globalErrorReceiver) {
val result = executeRequest(globalErrorReceiver) {
this.params = params
getSpaceHierarchy()
}
Timber.w("Space Info result: $result")
return result
}
private suspend fun getSpaceHierarchy() = try {
@ -57,7 +60,9 @@ internal class DefaultResolveSpaceInfoTask @Inject constructor(
suggestedOnly = params.suggestedOnly,
limit = params.limit,
maxDepth = params.maxDepth,
from = params.from)
from = params.from).also {
Timber.w("Spaces response stable: $it")
}
private suspend fun getUnstableSpaceHierarchy() =
spaceApi.getSpaceHierarchyUnstable(
@ -65,5 +70,7 @@ internal class DefaultResolveSpaceInfoTask @Inject constructor(
suggestedOnly = params.suggestedOnly,
limit = params.limit,
maxDepth = params.maxDepth,
from = params.from)
from = params.from).also {
Timber.w("Spaces response unstable: $it")
}
}