Модернизация не печатает журнал. Уровень журнала установлен в подробный. Пробовал HttpLoggingInterceptor тоже.Android Retrofit log не показывает
с использованием этих gradles
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.squareup.okhttp3:okhttp:3.2.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.3.1'
Код
OkHttpClient httpClient = new OkHttpClient();
HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
httpClient.newBuilder().connectTimeout(6, TimeUnit.MINUTES)
.readTimeout(6, TimeUnit.MINUTES)
.writeTimeout(6, TimeUnit.MINUTES)
.addInterceptor(new Interceptor() {
@Override
public Response intercept(Chain chain) throws IOException {
Request original = chain.request();
Request.Builder requestBuilder = original.newBuilder()
.header("Content-Type", "application/json")
.header("Authorization", "[email protected]#JG_a34-n3d")
.method(original.method(), original.body());
Request request = requestBuilder.build();
return chain.proceed(request);
}
})
.addInterceptor(httpLoggingInterceptor);
return httpClient;
U добавлен OkHttpClient для модернизации? – Esperanz0
Возможно, вы нашли ответ на свою проблему? – sanevys
@sanevys да ... Я правильно ответил –