When I was using Retrofit, I could easily create logging interceptors to see the calls with body and headers on the logcat:
val loggingInterceptor = HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY)
val httpClient = OkHttpClient.Builder()
.addInterceptor(loggingInterceptor)
and then
val retrofit = retrofit2.Retrofit.Builder()
.client(httpClient.build())
Now, we switched to Ktor and I don't know I dont know how
- to use
addInterceptor()? - and for [
install(CallLogging)][2] nothing happens..
Any suggestions or examples?
[2] source:
fun Application.main() {
install(CallLogging){
level = Level.TRACE
}
}