diff --git a/app/src/main/java/com/donnfelker/android/bootstrap/authenticator/BootstrapAccountAuthenticator.java b/app/src/main/java/com/donnfelker/android/bootstrap/authenticator/BootstrapAccountAuthenticator.java index 1913d2b..8bc31f9 100644 --- a/app/src/main/java/com/donnfelker/android/bootstrap/authenticator/BootstrapAccountAuthenticator.java +++ b/app/src/main/java/com/donnfelker/android/bootstrap/authenticator/BootstrapAccountAuthenticator.java @@ -16,8 +16,6 @@ import android.content.Context; import android.content.Intent; import android.os.Bundle; -import android.util.Log; - import com.donnfelker.android.bootstrap.core.Constants; class BootstrapAccountAuthenticator extends AbstractAccountAuthenticator { @@ -73,7 +71,7 @@ public Bundle editProperties(AccountAuthenticatorResponse response, String accou public Bundle getAuthToken(AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle options) throws NetworkErrorException { - Log.d("AccountAuthenticator", "Attempting to get authToken"); + Ln.d("Attempting to get authToken"); String authToken = AccountManager.get(context).peekAuthToken(account, authTokenType); Bundle bundle = new Bundle(); diff --git a/app/src/main/java/com/donnfelker/android/bootstrap/authenticator/BootstrapAuthenticatorActivity.java b/app/src/main/java/com/donnfelker/android/bootstrap/authenticator/BootstrapAuthenticatorActivity.java index b88f934..34e3bee 100644 --- a/app/src/main/java/com/donnfelker/android/bootstrap/authenticator/BootstrapAuthenticatorActivity.java +++ b/app/src/main/java/com/donnfelker/android/bootstrap/authenticator/BootstrapAuthenticatorActivity.java @@ -247,7 +247,7 @@ public Boolean call() throws Exception { .header(HEADER_PARSE_REST_API_KEY, PARSE_REST_API_KEY); - Log.d("Auth", "response=" + request.code()); + Ln.d("Authentication response=%s", request.code()); if(request.ok()) { final User model = new Gson().fromJson(Strings.toString(request.buffer()), User.class); diff --git a/app/src/main/java/com/donnfelker/android/bootstrap/authenticator/LogoutService.java b/app/src/main/java/com/donnfelker/android/bootstrap/authenticator/LogoutService.java index 4a2d74c..9df81d5 100644 --- a/app/src/main/java/com/donnfelker/android/bootstrap/authenticator/LogoutService.java +++ b/app/src/main/java/com/donnfelker/android/bootstrap/authenticator/LogoutService.java @@ -4,9 +4,8 @@ import android.accounts.AccountManager; import android.accounts.AccountManagerFuture; import android.content.Context; -import android.util.Log; - import com.donnfelker.android.bootstrap.core.Constants; +import com.donnfelker.android.bootstrap.util.Ln; import com.donnfelker.android.bootstrap.util.SafeAsyncTask; import javax.inject.Inject; @@ -62,7 +61,7 @@ public Boolean call() throws Exception { protected void onSuccess(Boolean accountWasRemoved) throws Exception { super.onSuccess(accountWasRemoved); - Log.d("LOGOUT_SERVICE", "Logout succeeded:" + accountWasRemoved); + Ln.d("Logout succeeded: %s", accountWasRemoved); onSuccess.run(); } @@ -70,7 +69,7 @@ protected void onSuccess(Boolean accountWasRemoved) throws Exception { @Override protected void onException(Exception e) throws RuntimeException { super.onException(e); - Log.e("LOGOUT_SERVICE", "Logout failed.", e.getCause()); + Ln.e(e.getCause(), "Logout failed."); } } } diff --git a/app/src/main/java/com/donnfelker/android/bootstrap/core/AvatarLoader.java b/app/src/main/java/com/donnfelker/android/bootstrap/core/AvatarLoader.java index 508e0d4..d57e2ff 100644 --- a/app/src/main/java/com/donnfelker/android/bootstrap/core/AvatarLoader.java +++ b/app/src/main/java/com/donnfelker/android/bootstrap/core/AvatarLoader.java @@ -9,11 +9,10 @@ import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.text.TextUtils; -import android.util.Log; import android.widget.ImageView; - import com.actionbarsherlock.app.ActionBar; import com.donnfelker.android.bootstrap.R; +import com.donnfelker.android.bootstrap.util.Ln; import com.donnfelker.android.bootstrap.util.SafeAsyncTask; import com.github.kevinsawicki.http.HttpRequest; import javax.inject.Inject; @@ -33,8 +32,6 @@ */ public class AvatarLoader { - private static final String TAG = "AvatarLoader"; - private static final float CORNER_RADIUS_IN_DIP = 3; private static final int CACHE_SIZE = 75; @@ -51,7 +48,7 @@ private FetchAvatarTask(Context context) { @Override protected void onException(Exception e) throws RuntimeException { - Log.d(TAG, "Avatar load failed", e); + Ln.d(e, "Avatar load failed"); } } @@ -189,7 +186,7 @@ protected BitmapDrawable fetchAvatar(final String url, final String userId) { else return null; } catch (IOException e) { - Log.d(TAG, "Exception writing rounded avatar", e); + Ln.d(e, "Exception writing rounded avatar"); return null; } finally { if (output != null) diff --git a/app/src/main/java/com/donnfelker/android/bootstrap/core/ImageUtils.java b/app/src/main/java/com/donnfelker/android/bootstrap/core/ImageUtils.java index 08f9543..f1d11fb 100644 --- a/app/src/main/java/com/donnfelker/android/bootstrap/core/ImageUtils.java +++ b/app/src/main/java/com/donnfelker/android/bootstrap/core/ImageUtils.java @@ -12,8 +12,8 @@ import android.graphics.Point; import android.graphics.PorterDuffXfermode; import android.graphics.RectF; -import android.util.Log; import android.widget.ImageView; +import com.donnfelker.android.bootstrap.util.Ln; import java.io.File; import java.io.IOException; @@ -24,8 +24,6 @@ */ public class ImageUtils { - private static final String TAG = "ImageUtils"; - /** * Get a bitmap from the image path * @@ -54,14 +52,14 @@ public static Bitmap getBitmap(final String imagePath, int sampleSize) { return BitmapFactory.decodeFileDescriptor(file.getFD(), null, options); } catch (IOException e) { - Log.d(TAG, e.getMessage(), e); + Ln.d(e, "Could not get cached bitmap."); return null; } finally { if (file != null) try { file.close(); } catch (IOException e) { - Log.d(TAG, e.getMessage(), e); + Ln.d(e, "Could not get cached bitmap."); } } } @@ -82,14 +80,14 @@ public static Point getSize(final String imagePath) { BitmapFactory.decodeFileDescriptor(file.getFD(), null, options); return new Point(options.outWidth, options.outHeight); } catch (IOException e) { - Log.d(TAG, e.getMessage(), e); + Ln.d(e, "Could not get size."); return null; } finally { if (file != null) try { file.close(); } catch (IOException e) { - Log.d(TAG, e.getMessage(), e); + Ln.d(e, "Could not get size."); } } } diff --git a/app/src/main/java/com/donnfelker/android/bootstrap/util/SafeAsyncTask.java b/app/src/main/java/com/donnfelker/android/bootstrap/util/SafeAsyncTask.java index e96f9f1..b5772d2 100644 --- a/app/src/main/java/com/donnfelker/android/bootstrap/util/SafeAsyncTask.java +++ b/app/src/main/java/com/donnfelker/android/bootstrap/util/SafeAsyncTask.java @@ -2,12 +2,15 @@ import android.os.Handler; import android.os.Looper; -import android.util.Log; import java.io.InterruptedIOException; import java.util.ArrayList; import java.util.Arrays; -import java.util.concurrent.*; +import java.util.concurrent.Callable; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.Executor; +import java.util.concurrent.Executors; +import java.util.concurrent.FutureTask; /** * Originally from RoboGuice: https://github.com/roboguice/roboguice/blob/master/roboguice/src/main/java/roboguice/util/SafeAsyncTask.java @@ -143,7 +146,7 @@ protected void onException( Exception e ) throws RuntimeException { } protected void onThrowable( Throwable t ) throws RuntimeException { - Log.e("roboguice", "Throwable caught during background processing", t); + Ln.e(t, "Throwable caught during background processing"); } /**