Created
July 19, 2013 06:03
-
-
Save okumura/6036982 to your computer and use it in GitHub Desktop.
Get Stack Trace to String by Java.
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
StringWriter sw = new StringWriter(); | |
PrintWriter pw = new PrintWriter(sw); | |
new Throwable().printStackTrace(pw); | |
String stackTraceString = sw.toString(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment