I convert the body of my exception to a string and then send a message about this exception with the given address in java. I want to format my exception string using html to make it human-readable format, similar to how it is displayed when the stack overflows. I was wondering if there are any Java libraries that do this?
StringWriter stringWriter = new StringWriter();
PrintWriter printWriter = new PrintWriter(stringWriter);
t.printStackTrace(printWriter);
String body = stringWriter.toString();
setMessageBody(body);
To reinforce, I mean things like a separate line with <br/>, display class name names with a different color font, display line numbers with a different color font. This can be done with some regular expressions, but I was wondering if there is a library that does this out of the box.
source
share