diff options
| author | Jonathan Lepage <jol@google.com> | 2021-11-16 00:55:37 +0000 |
|---|---|---|
| committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-11-16 00:55:37 +0000 |
| commit | 4e0b4bc2ce0800f7b14ef0c71d3152f5f1a832e2 (patch) | |
| tree | 5a3c3e6a00931e1ffa5037af08ab2a2d107e4740 /core/java/android | |
| parent | 573e89de921dfd5bd6c08e782fd2faab6fc6f014 (diff) | |
| parent | 2bf9cccba64e0cafb975de6e622d3e4344a0313d (diff) | |
Merge "Document that Log can quietly swallow UnknownHostExceptions." am: 9d01845696 am: fc60d843e6 am: 2bf9cccba6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1873073
Change-Id: If5276716a304cfc0e795e74d3457f2bf9b4f0f17
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/util/Log.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/java/android/util/Log.java b/core/java/android/util/Log.java index 12bcd8b0aa97..b5fe4f58dfb2 100644 --- a/core/java/android/util/Log.java +++ b/core/java/android/util/Log.java @@ -62,6 +62,10 @@ import java.net.UnknownHostException; * another buffer allocation and copy, and even more pressure on the gc. * That means that if your log message is filtered out, you might be doing * significant work and incurring significant overhead. + * + * <p>When calling the log methods that take a Throwable parameter, + * if any of the throwables in the cause chain is an <code>UnknownHostException</code>, + * then the stack trace is not logged. */ public final class Log { /** @hide */ @@ -341,6 +345,9 @@ public final class Log { /** * Handy function to get a loggable stack trace from a Throwable + + * <p>If any of the throwables in the cause chain is an <code>UnknownHostException</code>, + * this returns an empty string. * @param tr An exception to log */ @NonNull |
