network interface log print

private static void initOkHttpClient() {

if (okHttpClient == null) {
synchronized (RetrofitHelper1.class) {
if (okHttpClient == null) {
HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
okHttpClient = new OkHttpClient.Builder()
.addInterceptor(interceptor)
.build();
}
}
}

}





注意要添加OKLog的依赖!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325178745&siteId=291194637