Added debug log type

pull/207/head
M66B 3 years ago
parent d303a859a8
commit 0a92b677b2

@ -64,7 +64,7 @@ public class EntityLog {
@NonNull @NonNull
public String data; 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 = private static final ExecutorService executor =
Helper.getBackgroundExecutor(1, "log"); Helper.getBackgroundExecutor(1, "log");
@ -111,6 +111,9 @@ public class EntityLog {
if (context == null) if (context == null)
return; return;
if (type == Type.Debug &&
!(BuildConfig.DEBUG || BuildConfig.TEST_RELEASE))
return;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean main_log = prefs.getBoolean("main_log", true); boolean main_log = prefs.getBoolean("main_log", true);
@ -220,6 +223,8 @@ public class EntityLog {
return ContextCompat.getColor(context, R.color.solarizedBlue); return ContextCompat.getColor(context, R.color.solarizedBlue);
case Rules: case Rules:
return ContextCompat.getColor(context, R.color.solarizedCyan); return ContextCompat.getColor(context, R.color.solarizedCyan);
case Debug:
return Helper.resolveColor(context, R.attr.colorWarning);
default: default:
return null; return null;
} }

Loading…
Cancel
Save