-
Notifications
You must be signed in to change notification settings - Fork 586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an overload to FirebaseCrashlytics.recordException to attach additional custom key value pairs #6528
Conversation
Javadoc Changes:--- /home/runner/diff/original/firebase-kotlindoc/android/com/google/firebase/crashlytics/FirebaseCrashlytics.html 2024-12-05 20:39:24.625934594 +0000
+++ /home/runner/diff/modified/firebase-kotlindoc/android/com/google/firebase/crashlytics/FirebaseCrashlytics.html 2024-12-05 20:36:53.610282592 +0000
@@ -79,6 +79,13 @@
<tr>
<td><code>void</code></td>
<td>
+ <div><code><a href="/docs/reference/android/com/google/firebase/crashlytics/FirebaseCrashlytics.html#recordException(java.lang.Throwable,com.google.firebase.crashlytics.CustomKeysAndValues)">recordException</a>(<br> @<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/kotlin/java/lang/Throwable.html">Throwable</a> throwable,<br> @<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/crashlytics/CustomKeysAndValues.html">CustomKeysAndValues</a> keysAndValues<br>)</code></div>
+ <p>Records a non-fatal report to send to Crashlytics.</p>
+ </td>
+ </tr>
+ <tr>
+ <td><code>void</code></td>
+ <td>
<div><code><a href="/docs/reference/android/com/google/firebase/crashlytics/FirebaseCrashlytics.html#sendUnsentReports()">sendUnsentReports</a>()</code></div>
<p>If automatic data collection is disabled, this method queues up all the reports on a device to send to Crashlytics.</p>
</td>
@@ -333,6 +340,40 @@
</td>
</tr>
</tbody>
+ </table>
+ </div>
+ </div>
+ <div class="api-item"><a name="recordException(java.lang.Throwable, com.google.firebase.crashlytics.CustomKeysAndValues)"></a><a name="recordException-java.lang.Throwable-com.google.firebase.crashlytics.CustomKeysAndValues-"></a><a name="recordexception"></a>
+ <h3 class="api-name" id="recordException(java.lang.Throwable,com.google.firebase.crashlytics.CustomKeysAndValues)">recordException</h3>
+ <pre class="api-signature no-pretty-print">public void <a href="/docs/reference/android/com/google/firebase/crashlytics/FirebaseCrashlytics.html#recordException(java.lang.Throwable,com.google.firebase.crashlytics.CustomKeysAndValues)">recordException</a>(<br> @<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/kotlin/java/lang/Throwable.html">Throwable</a> throwable,<br> @<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/crashlytics/CustomKeysAndValues.html">CustomKeysAndValues</a> keysAndValues<br>)</pre>
+ <p>Records a non-fatal report to send to Crashlytics. </p>
+ <p>Combined with app level custom keys, the event is restricted to a maximum of 64 key/value pairs. New keys beyond that limit are ignored. Keys or values that exceed 1024 characters are truncated. </p>
+ <p>The values of event keys override the values of app level custom keys if they're identical.</p>
+ <div class="devsite-table-wrapper">
+ <table class="responsive">
+ <colgroup>
+ <col width="40%">
+ <col>
+ </colgroup>
+ <thead>
+ <tr>
+ <th colspan="100%">Parameters</th>
+ </tr>
+ </thead>
+ <tbody class="list">
+ <tr>
+ <td><code>@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/kotlin/java/lang/Throwable.html">Throwable</a> throwable</code></td>
+ <td>
+ <p>a <code><a href="https://developer.android.com/reference/kotlin/java/lang/Throwable.html">Throwable</a></code> to be recorded as a non-fatal event.</p>
+ </td>
+ </tr>
+ <tr>
+ <td><code>@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/crashlytics/CustomKeysAndValues.html">CustomKeysAndValues</a> keysAndValues</code></td>
+ <td>
+ <p>A dictionary of keys and the values to associate with the non fatal exception, in addition to the app level custom keys.</p>
+ </td>
+ </tr>
+ </tbody>
</table>
</div>
</div> --- /home/runner/diff/original/firebase-kotlindoc/kotlin/com/google/firebase/crashlytics/FirebaseCrashlytics.html 2024-12-05 20:39:24.613934621 +0000
+++ /home/runner/diff/modified/firebase-kotlindoc/kotlin/com/google/firebase/crashlytics/FirebaseCrashlytics.html 2024-12-05 20:36:53.594282619 +0000
@@ -79,6 +79,13 @@
<tr>
<td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></code></td>
<td>
+ <div><code><a href="/docs/reference/kotlin/com/google/firebase/crashlytics/FirebaseCrashlytics.html#recordException(java.lang.Throwable,com.google.firebase.crashlytics.CustomKeysAndValues)">recordException</a>(throwable: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html">Throwable</a>, keysAndValues: <a href="/docs/reference/kotlin/com/google/firebase/crashlytics/CustomKeysAndValues.html">CustomKeysAndValues</a>)</code></div>
+ <p>Records a non-fatal report to send to Crashlytics.</p>
+ </td>
+ </tr>
+ <tr>
+ <td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></code></td>
+ <td>
<div><code><a href="/docs/reference/kotlin/com/google/firebase/crashlytics/FirebaseCrashlytics.html#sendUnsentReports()">sendUnsentReports</a>()</code></div>
<p>If automatic data collection is disabled, this method queues up all the reports on a device to send to Crashlytics.</p>
</td>
@@ -333,6 +340,40 @@
</td>
</tr>
</tbody>
+ </table>
+ </div>
+ </div>
+ <div class="api-item"><a name="recordException(java.lang.Throwable, com.google.firebase.crashlytics.CustomKeysAndValues)"></a><a name="recordException-java.lang.Throwable-com.google.firebase.crashlytics.CustomKeysAndValues-"></a><a name="recordexception"></a>
+ <h3 class="api-name" id="recordException(java.lang.Throwable,com.google.firebase.crashlytics.CustomKeysAndValues)">recordException</h3>
+ <pre class="api-signature no-pretty-print">fun <a href="/docs/reference/kotlin/com/google/firebase/crashlytics/FirebaseCrashlytics.html#recordException(java.lang.Throwable,com.google.firebase.crashlytics.CustomKeysAndValues)">recordException</a>(throwable: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html">Throwable</a>, keysAndValues: <a href="/docs/reference/kotlin/com/google/firebase/crashlytics/CustomKeysAndValues.html">CustomKeysAndValues</a>): <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></pre>
+ <p>Records a non-fatal report to send to Crashlytics. </p>
+ <p>Combined with app level custom keys, the event is restricted to a maximum of 64 key/value pairs. New keys beyond that limit are ignored. Keys or values that exceed 1024 characters are truncated. </p>
+ <p>The values of event keys override the values of app level custom keys if they're identical.</p>
+ <div class="devsite-table-wrapper">
+ <table class="responsive">
+ <colgroup>
+ <col width="40%">
+ <col>
+ </colgroup>
+ <thead>
+ <tr>
+ <th colspan="100%">Parameters</th>
+ </tr>
+ </thead>
+ <tbody class="list">
+ <tr>
+ <td><code>throwable: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html">Throwable</a></code></td>
+ <td>
+ <p>a <code><a href="https://developer.android.com/reference/kotlin/java/lang/Throwable.html">Throwable</a></code> to be recorded as a non-fatal event.</p>
+ </td>
+ </tr>
+ <tr>
+ <td><code>keysAndValues: <a href="/docs/reference/kotlin/com/google/firebase/crashlytics/CustomKeysAndValues.html">CustomKeysAndValues</a></code></td>
+ <td>
+ <p>A dictionary of keys and the values to associate with the non fatal exception, in addition to the app level custom keys.</p>
+ </td>
+ </tr>
+ </tbody>
</table>
</div>
</div> |
Vertex AI Mock Responses Check
|
Coverage Report 1Affected Products
Test Logs |
The public api surface has changed for the subproject firebase-crashlytics: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
Test Results 8 files - 140 8 suites - 140 20s ⏱️ - 2m 41s Results for commit 79417ac. ± Comparison against base commit 37f8134. This pull request removes 1041 tests.
♻️ This comment has been updated with latest results. |
Size Report 1Affected Products
Test Logs |
The public api surface has changed for the subproject firebase-crashlytics: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
1 similar comment
The public api surface has changed for the subproject firebase-crashlytics: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
The public api surface has changed for the subproject firebase-crashlytics: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
1 similar comment
The public api surface has changed for the subproject firebase-crashlytics: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/FirebaseCrashlytics.java
Show resolved
Hide resolved
...crashlytics/src/main/java/com/google/firebase/crashlytics/internal/metadata/EventMetadata.kt
Show resolved
Hide resolved
...rashlytics/src/main/java/com/google/firebase/crashlytics/internal/metadata/UserMetadata.java
Outdated
Show resolved
Hide resolved
...rashlytics/src/main/java/com/google/firebase/crashlytics/internal/metadata/UserMetadata.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM just a few small nits!
This PR adds a method
public void recordException(@NonNull Throwable throwable, CustomKeysAndValues keysAndValues)
as an overload to the existingrecordException
method in Crashlytics to allow attaching additional custom keys to the specific event.Details:
Additionally:
sessionId
andtimestamp
attached to non fatal events.