summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jonathan Lepage <jol@google.com> 2021-10-28 01:14:26 +0000
committer Jonathan Lepage <jol@google.com> 2021-11-04 00:53:34 +0000
commitff42a9938bb7e459fd48c875a327709b8e4e4fd3 (patch)
tree2b32982f0a9a6e45e47d6d4b8217ae71d3628bf1
parent3120b13f56637dbbe272d85dce5c072df2f14f93 (diff)
Document that Log can quietly swallow UnknownHostExceptions.
Change-Id: I7d3239eadf7dd73dd1ff12d2924bb43d3e357299
-rw-r--r--core/java/android/util/Log.java7
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