Created
February 16, 2018 19:53
-
-
Save caseykulm/01fdd3448493b154c7c3cf34f575fc3e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DebugUtils { | |
public static void logCurrentStackTrace(Thread thread) { | |
List<StackTraceElement> traceElements = Arrays.asList(thread.getStackTrace()); | |
Timber.d("StackTrace: START"); | |
for (StackTraceElement traceElement : traceElements) { | |
Timber.d("\tStackTrace: %30s#%20s line: %4d", | |
traceElement.getClassName(), | |
traceElement.getMethodName(), | |
traceElement.getLineNumber()); | |
} | |
Timber.d("StackTrace: END"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment