From 0a92b677b2ab90f06ca00d5a2c27db71aa12bf73 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 22 Apr 2022 11:03:45 +0200 Subject: [PATCH] Added debug log type --- app/src/main/java/eu/faircode/email/EntityLog.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/EntityLog.java b/app/src/main/java/eu/faircode/email/EntityLog.java index 5c84981006..518a7e0c12 100644 --- a/app/src/main/java/eu/faircode/email/EntityLog.java +++ b/app/src/main/java/eu/faircode/email/EntityLog.java @@ -64,7 +64,7 @@ public class EntityLog { @NonNull public String data; - enum Type {General, Statistics, Scheduling, Network, Account, Protocol, Classification, Notification, Rules} + enum Type {General, Statistics, Scheduling, Network, Account, Protocol, Classification, Notification, Rules, Debug} private static final ExecutorService executor = Helper.getBackgroundExecutor(1, "log"); @@ -111,6 +111,9 @@ public class EntityLog { if (context == null) return; + if (type == Type.Debug && + !(BuildConfig.DEBUG || BuildConfig.TEST_RELEASE)) + return; SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); boolean main_log = prefs.getBoolean("main_log", true); @@ -220,6 +223,8 @@ public class EntityLog { return ContextCompat.getColor(context, R.color.solarizedBlue); case Rules: return ContextCompat.getColor(context, R.color.solarizedCyan); + case Debug: + return Helper.resolveColor(context, R.attr.colorWarning); default: return null; }