Added debug logging

This commit is contained in:
M66B
2022-11-09 14:02:24 +01:00
parent 04bfb2f167
commit fb3ceaae28
3 changed files with 12 additions and 3 deletions

View File

@@ -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");

View File

@@ -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)