LogRecordInterceptor

open class LogRecordInterceptor @JvmOverloads() constructor(enabled: Boolean, requestByteCount: Long, responseByteCount: Long) : Interceptor

网络日志记录器 可以参考此拦截器为项目中其他网络请求库配置. 本拦截器属于标准的OkHttp拦截器适用于所有OkHttp拦截器内核的网络请求库

在正式环境下请禁用此日志记录器. 因为他会消耗少量网络速度

Constructors

LogRecordInterceptor
Link copied to clipboard
fun LogRecordInterceptor(enabled: Boolean, requestByteCount: Long = 1024 * 1024, responseByteCount: Long = 1024 * 1024 * 4)

Functions

intercept
Link copied to clipboard
open override fun intercept(chain: Interceptor.Chain): Response

Properties

enabled
Link copied to clipboard
var enabled: Boolean
是否启用日志输出
requestByteCount
Link copied to clipboard
var requestByteCount: Long
请求日志输出字节数, -1 则为全部
responseByteCount
Link copied to clipboard
var responseByteCount: Long
响应日志输出字节数, -1 则为全部