Get rid of Log.d calls in src/main

Also, Log.d in tests don't make much sense - replace by Log.i. This way
it's easier to limit all Log.d calls to Utils.java.
This commit is contained in:
Daniel Martí 2016-04-24 15:06:11 +01:00
parent 70da6eaa12
commit 87a4cfb27c
4 changed files with 8 additions and 9 deletions

View File

@ -160,7 +160,7 @@ public class MultiRepoUpdaterTest extends InstrumentationTestCase {
* repository indeed contains the apks that it said it would provide. * repository indeed contains the apks that it said it would provide.
*/ */
private void assertExpected() { private void assertExpected() {
Log.d(TAG, "Asserting all versions of each .apk are in index."); Log.i(TAG, "Asserting all versions of each .apk are in index.");
List<Repo> repos = RepoProvider.Helper.all(context); List<Repo> repos = RepoProvider.Helper.all(context);
assertEquals("Repos", 3, repos.size()); assertEquals("Repos", 3, repos.size());
@ -173,7 +173,7 @@ public class MultiRepoUpdaterTest extends InstrumentationTestCase {
* *
*/ */
private void assertSomewhatAcceptable() { private void assertSomewhatAcceptable() {
Log.d(TAG, "Asserting at least one versions of each .apk is in index."); Log.i(TAG, "Asserting at least one versions of each .apk is in index.");
List<Repo> repos = RepoProvider.Helper.all(context); List<Repo> repos = RepoProvider.Helper.all(context);
assertEquals("Repos", 3, repos.size()); assertEquals("Repos", 3, repos.size());

View File

@ -200,7 +200,7 @@ public class TestUtils {
OutputStream output = null; OutputStream output = null;
try { try {
tempFile = File.createTempFile(assetName + "-", ".testasset", directory); tempFile = File.createTempFile(assetName + "-", ".testasset", directory);
Log.d(TAG, "Copying asset file " + assetName + " to directory " + directory); Log.i(TAG, "Copying asset file " + assetName + " to directory " + directory);
input = context.getAssets().open(assetName); input = context.getAssets().open(assetName);
output = new FileOutputStream(tempFile); output = new FileOutputStream(tempFile);
Utils.copy(input, output); Utils.copy(input, output);

View File

@ -8,7 +8,6 @@ import android.net.Uri;
import android.os.RemoteException; import android.os.RemoteException;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.util.Log;
import org.fdroid.fdroid.CompatibilityChecker; import org.fdroid.fdroid.CompatibilityChecker;
import org.fdroid.fdroid.RepoUpdater; import org.fdroid.fdroid.RepoUpdater;
@ -99,7 +98,7 @@ public class RepoPersister {
} }
if (apksToSave.size() > 0 || appsToSave.size() > 0) { if (apksToSave.size() > 0 || appsToSave.size() > 0) {
Log.d(TAG, "Flushing details of up to " + MAX_APP_BUFFER + " apps and their packages to the database."); Utils.debugLog(TAG, "Flushing details of up to " + MAX_APP_BUFFER + " apps and their packages to the database.");
flushAppsToDbInBatch(); flushAppsToDbInBatch();
flushApksToDbInBatch(); flushApksToDbInBatch();
apksToSave.clear(); apksToSave.clear();

View File

@ -24,8 +24,8 @@ import android.content.Context;
import android.content.pm.PackageInfo; import android.content.pm.PackageInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.pm.Signature; import android.content.pm.Signature;
import android.util.Log;
import org.fdroid.fdroid.Utils;
import org.spongycastle.util.encoders.Hex; import org.spongycastle.util.encoders.Hex;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
@ -58,9 +58,9 @@ public class ApkSignatureVerifier {
return true; return true;
} }
Log.d(TAG, "Signature mismatch!"); Utils.debugLog(TAG, "Signature mismatch!");
Log.d(TAG, "APK sig: " + Hex.toHexString(getApkSignature(apkFile))); Utils.debugLog(TAG, "APK sig: " + Hex.toHexString(getApkSignature(apkFile)));
Log.d(TAG, "F-Droid sig: " + Hex.toHexString(getFDroidSignature())); Utils.debugLog(TAG, "F-Droid sig: " + Hex.toHexString(getFDroidSignature()));
return false; return false;
} }