1
0
mirror of https://github.com/square/okhttp.git synced 2025-11-24 18:41:06 +03:00

Fix kotlin source compatibility with logger (#4927)

* Document broken kotlin source

* Fix existing code
This commit is contained in:
Yuri Schimke
2019-04-12 21:18:34 +01:00
committed by Jesse Wilson
parent 5828ebf9da
commit b89e9ed5c4
2 changed files with 3 additions and 0 deletions

View File

@@ -150,6 +150,8 @@ class LoggingEventListener private constructor(
open class Factory @JvmOverloads constructor(
private val logger: HttpLoggingInterceptor.Logger = HttpLoggingInterceptor.Logger.DEFAULT
) : EventListener.Factory {
constructor(block: (string: String) -> Unit): this(HttpLoggingInterceptor.Logger(block))
override fun create(call: Call): EventListener = LoggingEventListener(logger)
}
}