该拦截器用于记录应用中的网络请求的信息。
示例
OkHttpClient client = new OkHttpClient();
HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
logging.setLevel(Level.BASIC);
client.interceptors().add(logging);
HttpLoggingIntercetptor logging = new HttpLoggingInterceptor(new Logger() {
@Override
public void log(String message) {
Timber.tag("okhttp").d(message);
}
});