From ea825ac4c9bcb07c199f51473280a2544112ff9a Mon Sep 17 00:00:00 2001 From: Jay Ohms Date: Mon, 29 Apr 2024 17:38:44 -0400 Subject: [PATCH] Move the http logging interceptor to the top of the file, so it's declared before functions can be called into the singleton instance --- .../main/kotlin/dev/hotwire/turbo/http/TurboHttpClient.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/turbo/src/main/kotlin/dev/hotwire/turbo/http/TurboHttpClient.kt b/turbo/src/main/kotlin/dev/hotwire/turbo/http/TurboHttpClient.kt index 7197ddaa..f8979801 100644 --- a/turbo/src/main/kotlin/dev/hotwire/turbo/http/TurboHttpClient.kt +++ b/turbo/src/main/kotlin/dev/hotwire/turbo/http/TurboHttpClient.kt @@ -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() @@ -64,8 +67,4 @@ object TurboHttpClient { return builder.build() } - - private val loggingInterceptor = HttpLoggingInterceptor().apply { - level = HttpLoggingInterceptor.Level.BASIC - } }