Class LogInterceptor
java.lang.Object
com.algolia.internal.interceptors.LogInterceptor
- All Implemented Interfaces:
okhttp3.Interceptor
An interceptor that facilitates HTTP logging based on the provided logging level. This class
wraps around the
HttpLoggingInterceptor to provide additional flexibility in log
handling. It allows you to specify a custom Logger and a desired LogLevel.
Usage of this interceptor ensures that HTTP request and response details are logged according
to the specified logging level. For example, setting the log level to LogLevel.BODY would
result in detailed logging of both request and response bodies, while a level of LogLevel.BASIC would log request method, URL, and response status code.
-
Nested Class Summary
Nested classes/interfaces inherited from interface okhttp3.Interceptor
okhttp3.Interceptor.Chain, okhttp3.Interceptor.Companion -
Field Summary
Fields inherited from interface okhttp3.Interceptor
Companion -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
LogInterceptor
-
-
Method Details
-
toLogger
-
toLevel
-
intercept
@Nonnull public okhttp3.Response intercept(@Nonnull okhttp3.Interceptor.Chain chain) throws IOException - Specified by:
interceptin interfaceokhttp3.Interceptor- Throws:
IOException
-