-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix download-related crash, use Timber for logging
- Loading branch information
Showing
9 changed files
with
57 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
app/src/main/java/com/stevenschoen/putionew/CrashlyticsTree.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.stevenschoen.putionew; | ||
|
||
import android.support.annotation.Nullable; | ||
import android.util.Log; | ||
|
||
import com.crashlytics.android.Crashlytics; | ||
|
||
import timber.log.Timber; | ||
|
||
public class CrashlyticsTree extends Timber.Tree { | ||
private static final String CRASHLYTICS_KEY_PRIORITY = "priority"; | ||
private static final String CRASHLYTICS_KEY_TAG = "tag"; | ||
private static final String CRASHLYTICS_KEY_MESSAGE = "message"; | ||
|
||
@Override | ||
protected void log(int priority, @Nullable String tag, @Nullable String message, @Nullable Throwable t) { | ||
if (priority == Log.VERBOSE || priority == Log.DEBUG || priority == Log.INFO) { | ||
return; | ||
} | ||
|
||
Crashlytics.setInt(CRASHLYTICS_KEY_PRIORITY, priority); | ||
Crashlytics.setString(CRASHLYTICS_KEY_TAG, tag); | ||
Crashlytics.setString(CRASHLYTICS_KEY_MESSAGE, message); | ||
|
||
if (t == null) { | ||
Crashlytics.logException(new Exception(message)); | ||
} else { | ||
Crashlytics.logException(t); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters