public final class HttpLoggingInterceptor extends Object implements okhttp3.Interceptor
The format of the logs created by this class should not be considered stable and may change slightly between releases. If you need a stable logging format, use your own interceptor.
| Modifier and Type | Class and Description |
|---|---|
static class |
HttpLoggingInterceptor.Level
Log level
|
| Constructor and Description |
|---|
HttpLoggingInterceptor()
创建 Http 请求日志拦截器
|
HttpLoggingInterceptor(org.slf4j.Logger logger)
创建 Http 请求日志拦截器
|
| Modifier and Type | Method and Description |
|---|---|
okhttp3.Response |
intercept(okhttp3.Interceptor.Chain chain) |
HttpLoggingInterceptor |
setLevel(HttpLoggingInterceptor.Level level)
Change the level at which this interceptor logs.
|
public HttpLoggingInterceptor()
public HttpLoggingInterceptor(org.slf4j.Logger logger)
logger - 日志public HttpLoggingInterceptor setLevel(HttpLoggingInterceptor.Level level)
level - log levelpublic okhttp3.Response intercept(okhttp3.Interceptor.Chain chain)
throws IOException
intercept in interface okhttp3.InterceptorIOExceptionCopyright © 2018. All rights reserved.