Skip to content

Commit

Permalink
add connection interceptors in debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
sal0max committed Mar 29, 2024
1 parent 3e5b419 commit af769be
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
*/
Expand Down

0 comments on commit af769be

Please sign in to comment.