From 4ea5cdcb2606ab4135dfca5db64277d635ff11b1 Mon Sep 17 00:00:00 2001 From: Marc O'Morain Date: Wed, 1 Feb 2017 20:47:24 +0000 Subject: [PATCH 1/2] Add breadcrumbs to uncaught exceptions Fixes #114 --- .../src/main/java/com/joshdholtz/sentry/Sentry.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sentry-android/src/main/java/com/joshdholtz/sentry/Sentry.java b/sentry-android/src/main/java/com/joshdholtz/sentry/Sentry.java index ab94984..d4b4a24 100755 --- a/sentry-android/src/main/java/com/joshdholtz/sentry/Sentry.java +++ b/sentry-android/src/main/java/com/joshdholtz/sentry/Sentry.java @@ -87,7 +87,6 @@ public class Sentry { private static final String TAG = "Sentry"; private final static String sentryVersion = "7"; private static final int MAX_QUEUE_LENGTH = 50; - private static final int MAX_BREADCRUMBS = 10; public static boolean debug = false; @@ -517,6 +516,7 @@ public void uncaughtException(Thread thread, Throwable e) { // Here you should have a more robust, permanent record of problems SentryEventBuilder builder = new SentryEventBuilder(e, SentryEventLevel.FATAL); builder.setRelease(sentry.appInfo.versionName); + builder.event.put("breadcrumbs", sentry.breadcrumbs.current()); if (sentry.captureListener != null) { builder = sentry.captureListener.beforeCapture(builder); @@ -656,6 +656,10 @@ enum Type { private static class Breadcrumbs { + // The max number of breadcrumbs that will be tracked at any one time. + private static final int MAX_BREADCRUMBS = 10; + + // Access to this list must be thread-safe. // See GitHub Issue #110 // This list is protected by the provided ReadWriteLock. From edb70e90def39ea057eb592fb5d4c14b66667c8d Mon Sep 17 00:00:00 2001 From: Marc O'Morain Date: Wed, 1 Feb 2017 20:50:32 +0000 Subject: [PATCH 2/2] 1.5.3 release notes --- README.md | 1 + sentry-android/build.gradle | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 75f6c50..80ea70c 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,7 @@ table below shows an example of what the data will look like in Sentry. Version | Changes --- | --- +**1.5.4** | Ensure that breadcrumbs are added to all exceptions. [#115](https://github.com/joshdholtz/Sentry-Android/issues/115). **1.5.3** | Fix thread-safety bug when serializing breadcrumbs. [#110](https://github.com/joshdholtz/Sentry-Android/issues/110) (thanks to [fab1an](https://github.com/fab1an)). **1.5.2** | Send stack-frames to Sentry in the correct order. [#95](https://github.com/joshdholtz/Sentry-Android/pull/95).
Use the [versionName](https://developer.android.com/studio/publish/versioning.html#appversioning), rather than versionCode, as the default value for the release field of events (thanks to [FelixBondarenko](https://github.com/FelixBondarenko)). **1.5.1** | Revert accidental API removal of `captureException(Throwable, SentryEventLevel)`. diff --git a/sentry-android/build.gradle b/sentry-android/build.gradle index 56a35d5..44300b1 100644 --- a/sentry-android/build.gradle +++ b/sentry-android/build.gradle @@ -5,7 +5,7 @@ plugins { apply plugin: 'com.android.library' -def SentryAndroidVersion = "1.5.3" +def SentryAndroidVersion = "1.5.4" android { compileSdkVersion 24