Skip to content

Commit

Permalink
fix: use Log.d for debugging (ReVanced#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJeterLP committed Jul 7, 2022
1 parent f74a115 commit 605124b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
Expand Up @@ -29,7 +29,7 @@ public static boolean containsAd(String value, ByteBuffer buffer) {

try {
if (value == null || value.isEmpty() || !enabled) return false;
LogHelper.printException(LithoAdRemoval.class, "Searching for AD: " + value);
LogHelper.debug(LithoAdRemoval.class, "Searching for AD: " + value);

List<String> blockList = new ArrayList<>();
List<String> bufferBlockList = new ArrayList<>();
Expand Down
Expand Up @@ -193,34 +193,28 @@ public void saveValue(Object newValue) {
public int getInt() {
SettingsEnum.loadSettings();
if (value == null) value = -1;
LogHelper.debug(SettingsEnum.class, "Variable " + name() + " is " + value);
return (int) value;
}

public String getString() {
SettingsEnum.loadSettings();
LogHelper.debug(SettingsEnum.class, "Variable " + name() + " is " + value);
return (String) value;
}

public boolean getBoolean() {
SettingsEnum.loadSettings();
if (this != DEBUG_BOOLEAN)
LogHelper.debug(SettingsEnum.class, "Variable " + name() + " is " + value);
return (Boolean) value;
}

public Long getLong() {
SettingsEnum.loadSettings();
if (value == null) value = -1L;
LogHelper.debug(SettingsEnum.class, "Variable " + name() + " is " + value);
return (Long) value;
}

public Float getFloat() {
SettingsEnum.loadSettings();
if (value == null) value = -1.0f;
LogHelper.debug(SettingsEnum.class, "Variable " + name() + " is " + value);
return (Float) value;
}

Expand Down
Expand Up @@ -11,7 +11,7 @@ public class LogHelper {

public static void debug(Class clazz, String message) {
if (SettingsEnum.DEBUG_BOOLEAN.getBoolean()) {
Log.e("ReVanced: " + (clazz != null ? clazz.getSimpleName() : ""), message);
Log.d("ReVanced: " + (clazz != null ? clazz.getSimpleName() : ""), message);
}
}

Expand Down

0 comments on commit 605124b

Please sign in to comment.