Revert "Added debug classes"

This reverts commit 18c85872f3.
This commit is contained in:
M66B 2024-05-13 17:26:34 +02:00
parent 048c558ebd
commit a805164231
6 changed files with 12 additions and 16 deletions

View File

@ -100,7 +100,7 @@ internal class RoomTrackingLiveData<T> (
if (isActive) {
synchronized(lock) {
if (queued.value > 0) {
eu.faircode.email.Log.persist(eu.faircode.email.EntityLog.Type.Debug1, "$computeFunction queued=" + queued.value)
eu.faircode.email.Log.persist(eu.faircode.email.EntityLog.Type.Debug, "$computeFunction queued=" + queued.value)
} else {
queued.value++
queryExecutor.execute(refreshRunnable)

View File

@ -520,7 +520,7 @@ public class EmailService implements AutoCloseable {
if (auth == AUTH_TYPE_GMAIL || auth == AUTH_TYPE_OAUTH) {
try {
EntityLog.log(context, EntityLog.Type.Debug1,
EntityLog.log(context, EntityLog.Type.Debug,
ex + "\n" + android.util.Log.getStackTraceString(ex));
authenticator.refreshToken(true);
connect(dnssec, host, port, auth, user, factory);

View File

@ -65,7 +65,7 @@ public class EntityLog {
@NonNull
public String data;
public enum Type {General, Statistics, Scheduling, Network, Account, Protocol, Classification, Notification, Rules, Cloud, Debug1, Debug2, Debug3}
public enum Type {General, Statistics, Scheduling, Network, Account, Protocol, Classification, Notification, Rules, Cloud, Debug}
public static void log(final Context context, String data) {
log(context, Type.General, data);
@ -109,7 +109,7 @@ public class EntityLog {
if (context == null)
return;
if ((type == Type.Debug1 || type == Type.Debug2 || type == Type.Debug3) &&
if (type == Type.Debug &&
!(BuildConfig.DEBUG || Log.isTestRelease()))
return;
@ -233,12 +233,8 @@ public class EntityLog {
return ContextCompat.getColor(context, R.color.solarizedCyan);
case Cloud:
return ContextCompat.getColor(context, R.color.solarizedRed);
case Debug1:
return ContextCompat.getColor(context, R.color.solarizedRed);
case Debug2:
return ContextCompat.getColor(context, R.color.solarizedGreen);
case Debug3:
return ContextCompat.getColor(context, R.color.solarizedBlue);
case Debug:
return Helper.resolveColor(context, R.attr.colorWarning);
default:
return null;
}

View File

@ -24,6 +24,7 @@ import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.graphics.Typeface;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.text.SpannableStringBuilder;
import android.text.style.ForegroundColorSpan;
import android.text.style.StyleSpan;
@ -39,7 +40,6 @@ import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.constraintlayout.widget.Group;
import androidx.lifecycle.Observer;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
@ -203,7 +203,7 @@ public class FragmentLogs extends FragmentBase {
int len = EntityLog.Type.values().length;
if (!BuildConfig.DEBUG)
len -= 3;
len--;
SpannableStringBuilder[] titles = new SpannableStringBuilder[len];
boolean[] states = new boolean[len];

View File

@ -850,7 +850,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
@OnLifecycleEvent(Lifecycle.Event.ON_ANY)
public void onStateChanged() {
Lifecycle.State state = mowner.getLifecycle().getCurrentState();
EntityLog.log(ServiceSynchronize.this, EntityLog.Type.Debug1, "Owner state=" + state);
EntityLog.log(ServiceSynchronize.this, EntityLog.Type.Debug, "Owner state=" + state);
if (state.equals(Lifecycle.State.DESTROYED))
mowner.getLifecycle().removeObserver(this);
}
@ -872,7 +872,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
@Override
public void onChanged(boolean inCall) {
boolean suppress = prefs.getBoolean("notify_suppress_in_call", false);
EntityLog.log(ServiceSynchronize.this, EntityLog.Type.Debug1,
EntityLog.log(ServiceSynchronize.this, EntityLog.Type.Debug,
"In call=" + inCall + " suppress=" + suppress);
isInCall = (inCall && suppress);
boolean fg = Boolean.TRUE.equals(foreground.getValue());
@ -889,7 +889,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
boolean projection = (connectionState != null &&
connectionState == CarConnection.CONNECTION_TYPE_PROJECTION);
boolean suppress = prefs.getBoolean("notify_suppress_in_car", false);
EntityLog.log(ServiceSynchronize.this, EntityLog.Type.Debug1,
EntityLog.log(ServiceSynchronize.this, EntityLog.Type.Debug,
"Projection=" + projection + " state=" + connectionState + " suppress=" + suppress);
isInCar = (projection && suppress);
boolean fg = Boolean.TRUE.equals(foreground.getValue());

View File

@ -203,7 +203,7 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
LifecycleObserver watcher = new LifecycleObserver() {
@OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
public void onDestroy() {
EntityLog.log(context, EntityLog.Type.Debug1, "Owner gone task=" + name);
EntityLog.log(context, EntityLog.Type.Debug, "Owner gone task=" + name);
destroyed = true;
onDestroyed(args);
owner.getLifecycle().removeObserver(this);