diff --git a/app/src/main/kotlin/de/salomax/currencies/repository/ExchangeRatesService.kt b/app/src/main/kotlin/de/salomax/currencies/repository/ExchangeRatesService.kt index cb4ae427..28764358 100644 --- a/app/src/main/kotlin/de/salomax/currencies/repository/ExchangeRatesService.kt +++ b/app/src/main/kotlin/de/salomax/currencies/repository/ExchangeRatesService.kt @@ -2,7 +2,11 @@ package de.salomax.currencies.repository import android.content.Context import com.github.kittinunf.fuel.core.FuelError +import com.github.kittinunf.fuel.core.FuelManager +import com.github.kittinunf.fuel.core.interceptors.LogRequestInterceptor +import com.github.kittinunf.fuel.core.interceptors.LogResponseInterceptor import com.github.kittinunf.result.Result +import de.salomax.currencies.BuildConfig import de.salomax.currencies.model.ApiProvider import de.salomax.currencies.model.Currency import de.salomax.currencies.model.ExchangeRates @@ -11,6 +15,13 @@ import java.time.LocalDate object ExchangeRatesService { + init { + if (BuildConfig.DEBUG) { + FuelManager.instance.addRequestInterceptor { LogRequestInterceptor(it) } + FuelManager.instance.addResponseInterceptor { LogResponseInterceptor(it) } + } + } + /** * Get all the current exchange rates from the given api provider. Base will be Euro. */