public class LoggingInterceptor extends Object implements okhttp3.Interceptor
Constructor and Description |
---|
LoggingInterceptor(LogLevel logLevel)
Creates an interceptor with a LogLevel enum.
|
Modifier and Type | Method and Description |
---|---|
okhttp3.Response |
intercept(okhttp3.Interceptor.Chain chain) |
protected void |
log(org.slf4j.Logger logger,
String s)
Process the log using an SLF4j logger and an HTTP message.
|
LogLevel |
logLevel() |
LoggingInterceptor |
withLogLevel(LogLevel logLevel)
Sets the current logging level.
|
public LoggingInterceptor(LogLevel logLevel)
logLevel
- the level of traffic to logprotected void log(org.slf4j.Logger logger, String s)
logger
- the SLF4j logger with the context of the requests
- the message for loggingpublic okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException
intercept
in interface okhttp3.Interceptor
IOException
public LogLevel logLevel()
public LoggingInterceptor withLogLevel(LogLevel logLevel)
logLevel
- the new logging levelCopyright © 2019. All rights reserved.