Skip to content

Commit

Permalink
Move the http logging interceptor to the top of the file, so it's dec…
Browse files Browse the repository at this point in the history
…lared before functions can be called into the singleton instance
  • Loading branch information
jayohms committed Apr 29, 2024
1 parent f63e94f commit ea825ac
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import java.util.concurrent.TimeUnit
object TurboHttpClient {
private var cache: Cache? = null
private var httpCacheSize = 100L * 1024L * 1024L // 100 MBs
private val loggingInterceptor = HttpLoggingInterceptor().apply {
level = HttpLoggingInterceptor.Level.BASIC
}

internal var instance = buildNewHttpClient()

Expand Down Expand Up @@ -64,8 +67,4 @@ object TurboHttpClient {

return builder.build()
}

private val loggingInterceptor = HttpLoggingInterceptor().apply {
level = HttpLoggingInterceptor.Level.BASIC
}
}

0 comments on commit ea825ac

Please sign in to comment.