Android之Retrofit实现Log日志输出

我们知道,Retrofit是基于OkHttp发展而来,因此在Retrofit中设置日志打印,就是在OkHttp设置。 1、添加依赖 compile 'com.squareup.okhttp3:logging-interceptor:3.4.1' 2、添加打印代码 HttpLoggingInterceptor:http日志拦截器 方法1:自定义输出日志格式 HttpLoggingIntercepto
相关文章
相关标签/搜索