Added debug log type

This commit is contained in:
M66B 2022-04-22 11:03:45 +02:00
parent d303a859a8
commit 0a92b677b2
1 changed files with 6 additions and 1 deletions

View File

@ -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;
}