Skip to content

Commit ea825ac

Browse files
committed
Move the http logging interceptor to the top of the file, so it's declared before functions can be called into the singleton instance
1 parent f63e94f commit ea825ac

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

turbo/src/main/kotlin/dev/hotwire/turbo/http/TurboHttpClient.kt

+3-4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ import java.util.concurrent.TimeUnit
1717
object TurboHttpClient {
1818
private var cache: Cache? = null
1919
private var httpCacheSize = 100L * 1024L * 1024L // 100 MBs
20+
private val loggingInterceptor = HttpLoggingInterceptor().apply {
21+
level = HttpLoggingInterceptor.Level.BASIC
22+
}
2023

2124
internal var instance = buildNewHttpClient()
2225

@@ -64,8 +67,4 @@ object TurboHttpClient {
6467

6568
return builder.build()
6669
}
67-
68-
private val loggingInterceptor = HttpLoggingInterceptor().apply {
69-
level = HttpLoggingInterceptor.Level.BASIC
70-
}
7170
}

0 commit comments

Comments
 (0)