Hide more debug logs from release builds

This commit is contained in:
Daniel Martí 2015-05-29 17:00:08 +02:00
parent 02ed2293e6
commit d70fd02178
2 changed files with 10 additions and 3 deletions

View File

@ -230,7 +230,9 @@ public class Preferences implements SharedPreferences.OnSharedPreferenceChangeLi
@Override @Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
if (BuildConfig.DEBUG) {
Log.d(TAG, "Invalidating preference '" + key + "'."); Log.d(TAG, "Invalidating preference '" + key + "'.");
}
uninitialize(key); uninitialize(key);
switch (key) { switch (key) {

View File

@ -5,6 +5,7 @@ import android.os.Build;
import android.system.ErrnoException; import android.system.ErrnoException;
import android.util.Log; import android.util.Log;
import org.fdroid.fdroid.BuildConfig;
import org.fdroid.fdroid.Utils; import org.fdroid.fdroid.Utils;
import org.fdroid.fdroid.data.SanitizedFile; import org.fdroid.fdroid.data.SanitizedFile;
@ -58,7 +59,9 @@ public class FileCompat extends Compatibility {
dest.getAbsolutePath() dest.getAbsolutePath()
}; };
try { try {
if (BuildConfig.DEBUG) {
Log.d(TAG, "Executing command: " + commands[0] + " " + commands[1] + " " + commands[2]); Log.d(TAG, "Executing command: " + commands[0] + " " + commands[1] + " " + commands[2]);
}
Process proc = Runtime.getRuntime().exec(commands); Process proc = Runtime.getRuntime().exec(commands);
Utils.consumeStream(proc.getInputStream()); Utils.consumeStream(proc.getInputStream());
Utils.consumeStream(proc.getErrorStream()); Utils.consumeStream(proc.getErrorStream());
@ -106,7 +109,9 @@ public class FileCompat extends Compatibility {
}; };
try { try {
if (BuildConfig.DEBUG) {
Log.d(TAG, "Executing following command: " + args[0] + " " + args[1] + " " + args[2]); Log.d(TAG, "Executing following command: " + args[0] + " " + args[1] + " " + args[2]);
}
Process proc = Runtime.getRuntime().exec(args); Process proc = Runtime.getRuntime().exec(args);
Utils.consumeStream(proc.getInputStream()); Utils.consumeStream(proc.getInputStream());
Utils.consumeStream(proc.getErrorStream()); Utils.consumeStream(proc.getErrorStream());