本文整理匯總了Java中com.justwayward.reader.api.support.LoggingInterceptor類的典型用法代碼示例。如果您正苦於以下問題:Java LoggingInterceptor類的具體用法?Java LoggingInterceptor怎麽用?Java LoggingInterceptor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
LoggingInterceptor類屬於com.justwayward.reader.api.support包,在下文中一共展示了LoggingInterceptor類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: provideOkHttpClient
import com.justwayward.reader.api.support.LoggingInterceptor; //導入依賴的package包/類
@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();
}
示例2: onCreate
import com.justwayward.reader.api.support.LoggingInterceptor; //導入依賴的package包/類
@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();
}