Search in sources :

Example 1 with LoggingInterceptor

use of com.toshi.manager.network.interceptor.LoggingInterceptor in project toshi-android-client by toshiapp.

the class ChatService method addLogging.

private void addLogging() {
    final HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(new LoggingInterceptor());
    interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
    this.client.addInterceptor(interceptor);
}
Also used : HttpLoggingInterceptor(okhttp3.logging.HttpLoggingInterceptor) LoggingInterceptor(com.toshi.manager.network.interceptor.LoggingInterceptor) HttpLoggingInterceptor(okhttp3.logging.HttpLoggingInterceptor)

Example 2 with LoggingInterceptor

use of com.toshi.manager.network.interceptor.LoggingInterceptor in project toshi-android-client by toshiapp.

the class CurrencyService method addLogging.

private void addLogging() {
    final HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(new LoggingInterceptor());
    this.client.addInterceptor(interceptor);
}
Also used : HttpLoggingInterceptor(okhttp3.logging.HttpLoggingInterceptor) LoggingInterceptor(com.toshi.manager.network.interceptor.LoggingInterceptor) HttpLoggingInterceptor(okhttp3.logging.HttpLoggingInterceptor)

Example 3 with LoggingInterceptor

use of com.toshi.manager.network.interceptor.LoggingInterceptor in project toshi-android-client by toshiapp.

the class IdService method addLogging.

private void addLogging() {
    final HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(new LoggingInterceptor());
    interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
    this.client.addInterceptor(interceptor);
}
Also used : HttpLoggingInterceptor(okhttp3.logging.HttpLoggingInterceptor) LoggingInterceptor(com.toshi.manager.network.interceptor.LoggingInterceptor) HttpLoggingInterceptor(okhttp3.logging.HttpLoggingInterceptor)

Example 4 with LoggingInterceptor

use of com.toshi.manager.network.interceptor.LoggingInterceptor in project toshi-android-client by toshiapp.

the class ReputationService method addLogging.

private void addLogging() {
    final HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(new LoggingInterceptor());
    interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
    this.client.addInterceptor(interceptor);
}
Also used : HttpLoggingInterceptor(okhttp3.logging.HttpLoggingInterceptor) LoggingInterceptor(com.toshi.manager.network.interceptor.LoggingInterceptor) HttpLoggingInterceptor(okhttp3.logging.HttpLoggingInterceptor)

Example 5 with LoggingInterceptor

use of com.toshi.manager.network.interceptor.LoggingInterceptor in project toshi-android-client by toshiapp.

the class GlideOkHttpStack method registerComponents.

@Override
public void registerComponents(Context context, Glide glide) {
    final File cacheDir = new File(BaseApplication.get().getCacheDir(), "ToshiImageCache");
    final Cache cache = new Cache(cacheDir, MAX_SIZE);
    final OkHttpClient client = new OkHttpClient().newBuilder().cache(cache).addInterceptor(new AppInfoUserAgentInterceptor()).addInterceptor(new HttpLoggingInterceptor(new LoggingInterceptor()).setLevel(HttpLoggingInterceptor.Level.BODY)).build();
    glide.register(CachedGlideUrl.class, InputStream.class, superFactory(new OkHttpUrlLoader.Factory(client), CachedGlideUrl.class));
    glide.register(ForceLoadGlideUrl.class, InputStream.class, superFactory(new OkHttpUrlLoader.Factory(client), ForceLoadGlideUrl.class));
}
Also used : OkHttpClient(okhttp3.OkHttpClient) HttpLoggingInterceptor(okhttp3.logging.HttpLoggingInterceptor) LoggingInterceptor(com.toshi.manager.network.interceptor.LoggingInterceptor) ModelLoaderFactory(com.bumptech.glide.load.model.ModelLoaderFactory) AppInfoUserAgentInterceptor(com.toshi.manager.network.interceptor.AppInfoUserAgentInterceptor) File(java.io.File) HttpLoggingInterceptor(okhttp3.logging.HttpLoggingInterceptor) Cache(okhttp3.Cache)

Aggregations

LoggingInterceptor (com.toshi.manager.network.interceptor.LoggingInterceptor)6 HttpLoggingInterceptor (okhttp3.logging.HttpLoggingInterceptor)6 ModelLoaderFactory (com.bumptech.glide.load.model.ModelLoaderFactory)1 AppInfoUserAgentInterceptor (com.toshi.manager.network.interceptor.AppInfoUserAgentInterceptor)1 File (java.io.File)1 Cache (okhttp3.Cache)1 OkHttpClient (okhttp3.OkHttpClient)1