public final class HttpLoggingInterceptor extends java.lang.Object implements 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 |
static interface |
HttpLoggingInterceptor.Logger |
Interceptor.Chain
Modifier and Type | Field and Description |
---|---|
private HttpLoggingInterceptor.Level |
level |
private HttpLoggingInterceptor.Logger |
logger |
private static java.nio.charset.Charset |
UTF8 |
Constructor and Description |
---|
HttpLoggingInterceptor() |
HttpLoggingInterceptor(HttpLoggingInterceptor.Logger logger) |
Modifier and Type | Method and Description |
---|---|
private boolean |
bodyHasUnknownEncoding(Headers headers) |
HttpLoggingInterceptor.Level |
getLevel() |
Response |
intercept(Interceptor.Chain chain) |
(package private) static boolean |
isPlaintext(okio.Buffer buffer)
Returns true if the body in question probably contains human readable text.
|
HttpLoggingInterceptor |
setLevel(HttpLoggingInterceptor.Level level)
Change the level at which this interceptor logs.
|
private static final java.nio.charset.Charset UTF8
private final HttpLoggingInterceptor.Logger logger
private volatile HttpLoggingInterceptor.Level level
public HttpLoggingInterceptor()
public HttpLoggingInterceptor(HttpLoggingInterceptor.Logger logger)
public HttpLoggingInterceptor setLevel(HttpLoggingInterceptor.Level level)
public HttpLoggingInterceptor.Level getLevel()
public Response intercept(Interceptor.Chain chain) throws java.io.IOException
intercept
in interface Interceptor
java.io.IOException
static boolean isPlaintext(okio.Buffer buffer)
private boolean bodyHasUnknownEncoding(Headers headers)