refactor: move logs to timber
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package com.bitcointxoko.gudariwallet.service
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import timber.log.Timber
|
||||
import com.bitcointxoko.gudariwallet.api.NodeAliasClient as NodeAliasApiClient
|
||||
import com.bitcointxoko.gudariwallet.data.NodeAliasCacheRepository
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
@@ -26,14 +26,14 @@ class NodeAliasService(
|
||||
suspend fun resolve(pubkey: String): String? {
|
||||
// 1. Room cache hit
|
||||
repo.get(pubkey)?.let {
|
||||
Log.d(TAG, "ALIAS [CACHE HIT ] $pubkey → \"$it\"")
|
||||
Timber.d("ALIAS [CACHE HIT ] $pubkey → \"$it\"")
|
||||
return it
|
||||
}
|
||||
|
||||
// 2. Network via api/NodeAliasService (Retrofit, typed responses)
|
||||
Log.d(TAG, "ALIAS [CACHE MISS] $pubkey — fetching from network")
|
||||
Timber.d("ALIAS [CACHE MISS] $pubkey — fetching from network")
|
||||
val alias = apiClient.resolveAlias(pubkey) ?: run {
|
||||
Log.w(TAG, "ALIAS [NOT FOUND ] $pubkey")
|
||||
Timber.w("ALIAS [NOT FOUND ] $pubkey")
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ class NodeAliasService(
|
||||
// 4. Publish to StateFlow
|
||||
_aliases.value = _aliases.value + (pubkey to alias)
|
||||
|
||||
Log.d(TAG, "ALIAS [FETCHED ] $pubkey → \"$alias\"")
|
||||
Timber.d("ALIAS [FETCHED ] $pubkey → \"$alias\"")
|
||||
return alias
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user