Added log filtering

This commit is contained in:
M66B
2021-08-16 09:36:23 +02:00
parent 40ea1c3cb9
commit acee2a5014
10 changed files with 158 additions and 89 deletions

View File

@@ -55,25 +55,20 @@ public class EntityLog {
@NonNull
public Long time;
@NonNull
public Integer type = LOG_GENERAL;
public Type type = Type.General;
@NonNull
public String data;
static final int LOG_GENERAL = 0;
static final int LOG_STATS = 1;
static final int LOG_SCHEDULE = 2;
static final int LOG_NETWORK = 3;
static final int LOG_ACCOUNT = 4;
static final int LOG_PROTOCOL = 5;
enum Type {General, Statistics, Scheduling, Network, Account, Protocol}
private static final ExecutorService executor =
Helper.getBackgroundExecutor(1, "log");
static void log(final Context context, String data) {
log(context, LOG_GENERAL, data);
log(context, Type.General, data);
}
static void log(final Context context, int type, String data) {
static void log(final Context context, Type type, String data) {
Log.i(data);
if (context == null)