Commit c78896a3 authored by topjohnwu's avatar topjohnwu

Get rid of error logs

parent 316ec98e
......@@ -118,11 +118,8 @@ public class UpdateRepos extends ParallelTask<Void, Void, Void> {
mm.repoDB.addRepo(repo);
publishProgress();
}
if (!id.equals(repo.getId())) {
Logger.error("Repo [" + name + "] rid=[" + id + "] id=[" + repo.getId() + "] mismatch");
}
} catch (Repo.IllegalRepoException e) {
Logger.error(e.getMessage());
Logger.debug(e.getMessage());
mm.repoDB.removeRepo(id);
}
});
......@@ -205,7 +202,7 @@ public class UpdateRepos extends ParallelTask<Void, Void, Void> {
repo.update();
mm.repoDB.addRepo(repo);
} catch (Repo.IllegalRepoException e) {
Logger.error(e.getMessage());
Logger.debug(e.getMessage());
mm.repoDB.removeRepo(repo);
}
});
......
......@@ -44,7 +44,7 @@ public class Repo extends BaseModule {
throw new IllegalRepoException("Repo [" + repoName + "] does not contain versionCode");
}
if (getMinMagiskVersion() < Const.MIN_MODULE_VER()) {
Logger.error("Repo [" + repoName + "] is outdated");
Logger.debug("Repo [" + repoName + "] is outdated");
}
}
......
......@@ -2,18 +2,19 @@ package com.topjohnwu.magisk.utils;
import android.util.Log;
import com.topjohnwu.magisk.BuildConfig;
import java.util.Locale;
public class Logger {
private static final boolean SHELL_LOGGING = false;
public static void debug(String line) {
Log.d(Const.DEBUG_TAG, "DEBUG: " + line);
if (BuildConfig.DEBUG)
Log.d(Const.DEBUG_TAG, "DEBUG: " + line);
}
public static void debug(String fmt, Object... args) {
debug(String.format(Locale.US, fmt, args));
debug(Utils.fmt(fmt, args));
}
public static void error(String line) {
......@@ -21,16 +22,6 @@ public class Logger {
}
public static void error(String fmt, Object... args) {
error(String.format(Locale.US, fmt, args));
}
public static void shell(boolean in, String line) {
if (SHELL_LOGGING) {
Log.d(Const.DEBUG_TAG, (in ? "SHELLIN : " : "SHELLOUT: ") + line);
}
}
public static void shell(boolean in, String fmt, Object... args) {
shell(in, String.format(Locale.US, fmt, args));
error(Utils.fmt(fmt, args));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment