Document that Log can quietly swallow UnknownHostExceptions.

Change-Id: I7d3239eadf7dd73dd1ff12d2924bb43d3e357299
This commit is contained in:
Jonathan Lepage
2021-10-28 01:14:26 +00:00
parent 3120b13f56
commit ff42a9938b

View File

@@ -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