I'm trying to get rid of trash in logs, like
*�$ʞx���J/
when i recieve an image
So i tried to override HttpLoggingInterceptor intercept(), to detect is there a Content-Type => image/jpeg header in responce, but HttpLoggingInterceptor is final so i cant extend it :(
Code in RetrofitModule:
OkHttpClient provideOkHttpClient(Context context, Application app, Preferences preferences) {
HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
loggingInterceptor.setLevel(BuildConfig.DEBUG ? HttpLoggingInterceptor.Level.BODY : HttpLoggingInterceptor.Level.HEADERS);
Cache cache = new Cache(app.getCacheDir(), cacheSize);
return new OkHttpClient.Builder()
.addNetworkInterceptor(new OkHttpInterceptor(context, preferences))
.addInterceptor(loggingInterceptor)
.cache(cache)
.build();
}
How can i disable image-logging in my project?