Get rid of error logs

This commit is contained in:
topjohnwu 2018-07-04 18:11:57 +08:00
parent 316ec98e0f
commit c78896a335
3 changed files with 9 additions and 21 deletions

View File

@ -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);
}
});

View File

@ -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");
}
}

View File

@ -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) {
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));
}
}