Enable strict mode logging

pull/491/merge
Alex Baker 9 years ago
parent 7a09c6ba8e
commit 92610623e8

@ -2,6 +2,7 @@ package org.tasks;
import android.app.Application; import android.app.Application;
import android.content.Context; import android.content.Context;
import android.os.StrictMode;
import com.facebook.stetho.Stetho; import com.facebook.stetho.Stetho;
import com.facebook.stetho.timber.StethoTree; import com.facebook.stetho.timber.StethoTree;
@ -26,5 +27,16 @@ public class BuildSetup {
Timber.plant(new StethoTree()); Timber.plant(new StethoTree());
Stetho.initializeWithDefaults(context); Stetho.initializeWithDefaults(context);
LeakCanary.install((Application) context.getApplicationContext()); LeakCanary.install((Application) context.getApplicationContext());
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectDiskReads()
.detectDiskWrites()
.detectNetwork()
.penaltyLog()
.build());
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
.detectLeakedSqlLiteObjects()
.detectLeakedClosableObjects()
.penaltyLog()
.build());
} }
} }

Loading…
Cancel
Save