Skip to content

Commit

Permalink
change buildconfig to point to app
Browse files Browse the repository at this point in the history
  • Loading branch information
rafsanahmad committed Nov 15, 2021
1 parent 959996b commit 6c37e50
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/src/main/java/com/rafsan/newsapp/di/ApplicationModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
package com.rafsan.newsapp.di

import android.content.Context
import androidx.viewbinding.BuildConfig
import android.util.Log
import com.google.gson.GsonBuilder
import com.rafsan.newsapp.BuildConfig
import com.rafsan.newsapp.data.local.NewsDao
import com.rafsan.newsapp.data.local.NewsDatabase
import com.rafsan.newsapp.network.api.ApiHelper
Expand All @@ -32,10 +33,14 @@ import javax.inject.Singleton
@InstallIn(SingletonComponent::class)
object ApplicationModule {

private val TAG = "NewsApp"

@Provides
@Singleton
fun provideOkHttpClient() = if (BuildConfig.DEBUG) {
val loggingInterceptor = HttpLoggingInterceptor()
val loggingInterceptor = HttpLoggingInterceptor { message ->
Log.d(TAG, message)
}
loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY)
OkHttpClient.Builder()
.addInterceptor(loggingInterceptor)
Expand Down

0 comments on commit 6c37e50

Please sign in to comment.