Replace printStackTrace with proper Log.e calls
This commit is contained in:
parent
8669fddd70
commit
1f41bbdc0d
@ -39,6 +39,7 @@ import android.os.Message;
|
||||
import android.os.Messenger;
|
||||
import android.os.RemoteException;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.nostra13.universalimageloader.cache.disc.impl.LimitedAgeDiskCache;
|
||||
@ -63,6 +64,8 @@ import java.util.Set;
|
||||
|
||||
public class FDroidApp extends Application {
|
||||
|
||||
private static final String TAG = "FDroidApp";
|
||||
|
||||
// for the local repo on this device, all static since there is only one
|
||||
public static int port;
|
||||
public static String ipAddressString;
|
||||
@ -295,8 +298,8 @@ public class FDroidApp extends Application {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (PackageManager.NameNotFoundException e1) {
|
||||
e1.printStackTrace();
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
Log.e(TAG, "Could not get application info to send via bluetooth", e);
|
||||
found = false;
|
||||
}
|
||||
if (sendBt != null) {
|
||||
@ -351,7 +354,7 @@ public class FDroidApp extends Application {
|
||||
Message msg = Message.obtain(null, LocalRepoService.RESTART, LocalRepoService.RESTART, 0);
|
||||
localRepoServiceMessenger.send(msg);
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
Log.e(TAG, "Could not reset local repo service", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,9 +10,12 @@ import android.nfc.NdefMessage;
|
||||
import android.nfc.NdefRecord;
|
||||
import android.nfc.NfcAdapter;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
public class NfcHelper {
|
||||
|
||||
private static final String TAG = "NfcHelper";
|
||||
|
||||
@TargetApi(14)
|
||||
private static NfcAdapter getAdapter(Context context) {
|
||||
if (Build.VERSION.SDK_INT < 14)
|
||||
@ -48,7 +51,7 @@ public class NfcHelper {
|
||||
};
|
||||
nfcAdapter.setBeamPushUris(uris, activity);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
Log.e(TAG, "Could not get application info", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ public class RepoUpdater {
|
||||
String versionName = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
|
||||
urlString += "?client_version=" + versionName;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
Log.e(TAG, "Could not get client version name", e);
|
||||
}
|
||||
return new URL(urlString);
|
||||
}
|
||||
|
@ -100,9 +100,7 @@ public class InstalledAppProvider extends FDroidProvider {
|
||||
try {
|
||||
appInfo = pm.getApplicationInfo(packageName, PackageManager.GET_META_DATA);
|
||||
return appInfo.loadLabel(pm).toString();
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (Resources.NotFoundException e) {
|
||||
} catch (PackageManager.NameNotFoundException | Resources.NotFoundException e) {
|
||||
Utils.DebugLog(TAG, "Could not get application label", e);
|
||||
}
|
||||
return packageName; // all else fails, return id
|
||||
|
@ -7,6 +7,7 @@ import android.net.wifi.WifiManager.MulticastLock;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@ -105,7 +106,7 @@ public class MDnsHelper implements ServiceListener {
|
||||
};
|
||||
mJmdns = JmDNS.create(InetAddress.getByAddress(byteIp));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Log.e(TAG, "An error occured while discovering services", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -171,8 +171,8 @@ public class WifiStateChangeService extends Service {
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (SocketException ex) {
|
||||
ex.printStackTrace();
|
||||
} catch (SocketException e) {
|
||||
Log.e(TAG, "Could not get ip address", e);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -10,6 +10,7 @@ import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v7.app.ActionBarActivity;
|
||||
import android.util.Log;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.Toast;
|
||||
|
||||
@ -268,7 +269,7 @@ public class SwapActivity extends ActionBarActivity implements SwapProcessManage
|
||||
}
|
||||
}.execute();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Log.e(TAG, "An error occured while setting up the local repo", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user