Skip to content

Commit b66478d

Browse files
author
Jon Willis
committed
Replace straggling calls to Log.x() with Ln.x().
1 parent fe207e2 commit b66478d

File tree

6 files changed

+19
-24
lines changed

6 files changed

+19
-24
lines changed

app/src/main/java/com/donnfelker/android/bootstrap/authenticator/BootstrapAccountAuthenticator.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
import android.content.Context;
1717
import android.content.Intent;
1818
import android.os.Bundle;
19-
import android.util.Log;
20-
2119
import com.donnfelker.android.bootstrap.core.Constants;
2220

2321
class BootstrapAccountAuthenticator extends AbstractAccountAuthenticator {
@@ -73,7 +71,7 @@ public Bundle editProperties(AccountAuthenticatorResponse response, String accou
7371
public Bundle getAuthToken(AccountAuthenticatorResponse response, Account account, String authTokenType,
7472
Bundle options) throws NetworkErrorException {
7573

76-
Log.d("AccountAuthenticator", "Attempting to get authToken");
74+
Ln.d("Attempting to get authToken");
7775

7876
String authToken = AccountManager.get(context).peekAuthToken(account, authTokenType);
7977
Bundle bundle = new Bundle();

app/src/main/java/com/donnfelker/android/bootstrap/authenticator/BootstrapAuthenticatorActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public Boolean call() throws Exception {
247247
.header(HEADER_PARSE_REST_API_KEY, PARSE_REST_API_KEY);
248248

249249

250-
Log.d("Auth", "response=" + request.code());
250+
Ln.d("Authentication response=%s", request.code());
251251

252252
if(request.ok()) {
253253
final User model = new Gson().fromJson(Strings.toString(request.buffer()), User.class);

app/src/main/java/com/donnfelker/android/bootstrap/authenticator/LogoutService.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
import android.accounts.AccountManager;
55
import android.accounts.AccountManagerFuture;
66
import android.content.Context;
7-
import android.util.Log;
8-
97
import com.donnfelker.android.bootstrap.core.Constants;
8+
import com.donnfelker.android.bootstrap.util.Ln;
109
import com.donnfelker.android.bootstrap.util.SafeAsyncTask;
1110

1211
import javax.inject.Inject;
@@ -62,15 +61,15 @@ public Boolean call() throws Exception {
6261
protected void onSuccess(Boolean accountWasRemoved) throws Exception {
6362
super.onSuccess(accountWasRemoved);
6463

65-
Log.d("LOGOUT_SERVICE", "Logout succeeded:" + accountWasRemoved);
64+
Ln.d("Logout succeeded: %s", accountWasRemoved);
6665
onSuccess.run();
6766

6867
}
6968

7069
@Override
7170
protected void onException(Exception e) throws RuntimeException {
7271
super.onException(e);
73-
Log.e("LOGOUT_SERVICE", "Logout failed.", e.getCause());
72+
Ln.e(e.getCause(), "Logout failed.");
7473
}
7574
}
7675
}

app/src/main/java/com/donnfelker/android/bootstrap/core/AvatarLoader.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99
import android.graphics.drawable.BitmapDrawable;
1010
import android.graphics.drawable.Drawable;
1111
import android.text.TextUtils;
12-
import android.util.Log;
1312
import android.widget.ImageView;
14-
1513
import com.actionbarsherlock.app.ActionBar;
1614
import com.donnfelker.android.bootstrap.R;
15+
import com.donnfelker.android.bootstrap.util.Ln;
1716
import com.donnfelker.android.bootstrap.util.SafeAsyncTask;
1817
import com.github.kevinsawicki.http.HttpRequest;
1918
import javax.inject.Inject;
@@ -33,8 +32,6 @@
3332
*/
3433
public class AvatarLoader {
3534

36-
private static final String TAG = "AvatarLoader";
37-
3835
private static final float CORNER_RADIUS_IN_DIP = 3;
3936

4037
private static final int CACHE_SIZE = 75;
@@ -51,7 +48,7 @@ private FetchAvatarTask(Context context) {
5148

5249
@Override
5350
protected void onException(Exception e) throws RuntimeException {
54-
Log.d(TAG, "Avatar load failed", e);
51+
Ln.d(e, "Avatar load failed");
5552
}
5653
}
5754

@@ -189,7 +186,7 @@ protected BitmapDrawable fetchAvatar(final String url, final String userId) {
189186
else
190187
return null;
191188
} catch (IOException e) {
192-
Log.d(TAG, "Exception writing rounded avatar", e);
189+
Ln.d(e, "Exception writing rounded avatar");
193190
return null;
194191
} finally {
195192
if (output != null)

app/src/main/java/com/donnfelker/android/bootstrap/core/ImageUtils.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
import android.graphics.Point;
1313
import android.graphics.PorterDuffXfermode;
1414
import android.graphics.RectF;
15-
import android.util.Log;
1615
import android.widget.ImageView;
16+
import com.donnfelker.android.bootstrap.util.Ln;
1717

1818
import java.io.File;
1919
import java.io.IOException;
@@ -24,8 +24,6 @@
2424
*/
2525
public class ImageUtils {
2626

27-
private static final String TAG = "ImageUtils";
28-
2927
/**
3028
* Get a bitmap from the image path
3129
*
@@ -54,14 +52,14 @@ public static Bitmap getBitmap(final String imagePath, int sampleSize) {
5452
return BitmapFactory.decodeFileDescriptor(file.getFD(), null,
5553
options);
5654
} catch (IOException e) {
57-
Log.d(TAG, e.getMessage(), e);
55+
Ln.d(e, "Could not get cached bitmap.");
5856
return null;
5957
} finally {
6058
if (file != null)
6159
try {
6260
file.close();
6361
} catch (IOException e) {
64-
Log.d(TAG, e.getMessage(), e);
62+
Ln.d(e, "Could not get cached bitmap.");
6563
}
6664
}
6765
}
@@ -82,14 +80,14 @@ public static Point getSize(final String imagePath) {
8280
BitmapFactory.decodeFileDescriptor(file.getFD(), null, options);
8381
return new Point(options.outWidth, options.outHeight);
8482
} catch (IOException e) {
85-
Log.d(TAG, e.getMessage(), e);
83+
Ln.d(e, "Could not get size.");
8684
return null;
8785
} finally {
8886
if (file != null)
8987
try {
9088
file.close();
9189
} catch (IOException e) {
92-
Log.d(TAG, e.getMessage(), e);
90+
Ln.d(e, "Could not get size.");
9391
}
9492
}
9593
}

app/src/main/java/com/donnfelker/android/bootstrap/util/SafeAsyncTask.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22

33
import android.os.Handler;
44
import android.os.Looper;
5-
import android.util.Log;
65

76
import java.io.InterruptedIOException;
87
import java.util.ArrayList;
98
import java.util.Arrays;
10-
import java.util.concurrent.*;
9+
import java.util.concurrent.Callable;
10+
import java.util.concurrent.CountDownLatch;
11+
import java.util.concurrent.Executor;
12+
import java.util.concurrent.Executors;
13+
import java.util.concurrent.FutureTask;
1114

1215
/**
1316
* 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 {
143146
}
144147

145148
protected void onThrowable( Throwable t ) throws RuntimeException {
146-
Log.e("roboguice", "Throwable caught during background processing", t);
149+
Ln.e(t, "Throwable caught during background processing");
147150
}
148151

149152
/**

0 commit comments

Comments
 (0)