网络接口log打印

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的依赖!
posted @   Ars灬木子  阅读(132)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示