Created
November 14, 2011 13:54
-
-
Save ebouchut/1363993 to your computer and use it in GitHub Desktop.
Print a StackTrace in a String
This file contains hidden or 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 writer = new StringWriter(); | |
e.printStackTrace( | |
new PrintStream( | |
new WriterOutputStream( | |
new PrintWriter(writer) | |
) | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment