MCPcopy Create free account
hub / github.com/LineageOS/android_frameworks_base / getStackTraceString

Method getStackTraceString

core/java/android/util/Log.java:317–337  ·  view source on GitHub ↗

Handy function to get a loggable stack trace from a Throwable @param tr An exception to log

(Throwable tr)

Source from the content-addressed store, hash-verified

315 * @param tr An exception to log
316 */
317 public static String getStackTraceString(Throwable tr) {
318 if (tr == null) {
319 return "";
320 }
321
322 // This is to reduce the amount of log spew that apps do in the non-error
323 // condition of the network being unavailable.
324 Throwable t = tr;
325 while (t != null) {
326 if (t instanceof UnknownHostException) {
327 return "";
328 }
329 t = t.getCause();
330 }
331
332 StringWriter sw = new StringWriter();
333 PrintWriter pw = new FastPrintWriter(sw, false, 256);
334 tr.printStackTrace(pw);
335 pw.flush();
336 return sw.toString();
337 }
338
339 /**
340 * Low-level logging call.

Callers 15

inflateFromIntentMethod · 0.95
connectMethod · 0.95
disconnectMethod · 0.95
getConnectedDevicesMethod · 0.95
getConnectionStateMethod · 0.95
setPriorityMethod · 0.95
getPriorityMethod · 0.95
startVoiceRecognitionMethod · 0.95
stopVoiceRecognitionMethod · 0.95
isAudioConnectedMethod · 0.95
getBatteryUsageHintMethod · 0.95

Calls 2

flushMethod · 0.95
toStringMethod · 0.45

Tested by 1

setUpWebViewMethod · 0.76