diff --git a/app/src/main/java/androidx/room/RoomTrackingLiveData.java b/app/src/main/java/androidx/room/RoomTrackingLiveData.java index f63ac694c2..10c4fbcf8b 100644 --- a/app/src/main/java/androidx/room/RoomTrackingLiveData.java +++ b/app/src/main/java/androidx/room/RoomTrackingLiveData.java @@ -31,6 +31,8 @@ import java.util.concurrent.Executor; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; +import eu.faircode.email.EntityLog; + /** * A LiveData implementation that closely works with {@link InvalidationTracker} to implement * database drive {@link androidx.lifecycle.LiveData} queries that are strongly hold as long @@ -114,8 +116,8 @@ class RoomTrackingLiveData extends LiveData { @Override public void run() { if (running.get() == 0 && queued.get() > 0) { - eu.faircode.email.Log.i(mComputeFunction + - " running=" + running + " queued=" + queued); + eu.faircode.email.Log.persist(EntityLog.Type.Debug, + mComputeFunction + " running=" + running + " queued=" + queued); return; } boolean isActive = hasActiveObservers(); diff --git a/app/src/main/java/eu/faircode/email/EntityLog.java b/app/src/main/java/eu/faircode/email/EntityLog.java index 27f3d3856f..983b593a90 100644 --- a/app/src/main/java/eu/faircode/email/EntityLog.java +++ b/app/src/main/java/eu/faircode/email/EntityLog.java @@ -65,7 +65,7 @@ public class EntityLog { @NonNull public String data; - enum Type {General, Statistics, Scheduling, Network, Account, Protocol, Classification, Notification, Rules, Debug} + public enum Type {General, Statistics, Scheduling, Network, Account, Protocol, Classification, Notification, Rules, Debug} private static final ExecutorService executor = Helper.getBackgroundExecutor(1, "log"); diff --git a/app/src/main/java/eu/faircode/email/Log.java b/app/src/main/java/eu/faircode/email/Log.java index ea7fc2b095..8e226e0abe 100644 --- a/app/src/main/java/eu/faircode/email/Log.java +++ b/app/src/main/java/eu/faircode/email/Log.java @@ -360,6 +360,13 @@ public class Log { EntityLog.log(ctx, message); } + public static void persist(EntityLog.Type type, String message) { + if (ctx == null) + Log.e(message); + else + EntityLog.log(ctx, type, message); + } + static void setCrashReporting(boolean enabled) { try { if (enabled)