Add logging with Timber

This commit is contained in:
Kirill Kamakin
2021-11-07 12:13:46 +03:00
parent b0a53b5991
commit daa8006e4e
9 changed files with 59 additions and 10 deletions

View File

@@ -5,11 +5,13 @@ import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.json.Json
import okhttp3.MediaType
import retrofit2.Retrofit
import timber.log.Timber
import javax.inject.Inject
@ExperimentalSerializationApi
class RetrofitBuilder @Inject constructor() {
fun buildRetrofit(baseUrl: String): Retrofit {
Timber.v("buildRetrofit() called with: baseUrl = $baseUrl")
val url = if (baseUrl.startsWith("http")) baseUrl else "https://$baseUrl"
val contentType = MediaType.get("application/json")
return Retrofit.Builder()