Class HttpLoggingInterceptor

java.lang.Object
net.dreamlu.mica.http.HttpLoggingInterceptor
All Implemented Interfaces:
okhttp3.Interceptor

public final class HttpLoggingInterceptor extends Object implements okhttp3.Interceptor
An OkHttp interceptor which logs request and response information. Can be applied as an application interceptor or as a network 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.

Author:
okhttp、L.cm
  • Constructor Details

  • Method Details

    • setLevel

      public HttpLoggingInterceptor setLevel(LogLevel level)
      Change the level at which this interceptor logs.
      Parameters:
      level - log Level
      Returns:
      HttpLoggingInterceptor
    • intercept

      public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException
      Specified by:
      intercept in interface okhttp3.Interceptor
      Throws:
      IOException