LoggingInterceptor

class LoggingInterceptor(level: LoggingInterceptor.Level, log: (String) -> Unit = { println(it) }) : HttpInterceptor

An interceptor that logs requests and responses.

Parameters

level

the level of logging. Caution: when uploading files, setting this to Level.BODY will cause the files to be fully loaded into memory, which may cause OutOfMemoryErrors.

Constructors

Link copied to clipboard
fun LoggingInterceptor(log: (String) -> Unit = { println(it) })
Link copied to clipboard
fun LoggingInterceptor(level: LoggingInterceptor.Level, log: (String) -> Unit = { println(it) })

Types

Link copied to clipboard
enum Level : Enum<LoggingInterceptor.Level>

Functions

Link copied to clipboard
open fun dispose()
Link copied to clipboard
open suspend override fun intercept(request: HttpRequest, chain: HttpInterceptorChain): HttpResponse