网络接口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 @ 2018-05-02 20:02  Ars灬木子  阅读(132)  评论(0编辑  收藏  举报