use of com.justwayward.reader.api.support.LoggingInterceptor in project BookReader by JustWayward.
the class BookApiModule method provideOkHttpClient.
@Provides
public OkHttpClient provideOkHttpClient() {
LoggingInterceptor logging = new LoggingInterceptor(new Logger());
logging.setLevel(LoggingInterceptor.Level.BODY);
OkHttpClient.Builder builder = new OkHttpClient.Builder().connectTimeout(10, TimeUnit.SECONDS).connectTimeout(20 * 1000, TimeUnit.MILLISECONDS).readTimeout(20 * 1000, TimeUnit.MILLISECONDS).retryOnConnectionFailure(// 失败重发
true).addInterceptor(new HeaderInterceptor()).addInterceptor(logging);
return builder.build();
}
use of com.justwayward.reader.api.support.LoggingInterceptor in project BookReader by JustWayward.
the class DownloadBookService method onCreate.
@Override
public void onCreate() {
super.onCreate();
EventBus.getDefault().register(this);
LoggingInterceptor logging = new LoggingInterceptor(new Logger());
logging.setLevel(LoggingInterceptor.Level.BODY);
bookApi = ReaderApplication.getsInstance().getAppComponent().getReaderApi();
}
Aggregations