I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 0e53445e authored by zzz's avatar zzz
Browse files

* logs.jsp: Format multiline messages better

parent 3ee85fed
No related branches found
No related tags found
No related merge requests found
......@@ -44,6 +44,8 @@ public class LogsHelper extends HelperBase {
}
******/
private final static String NL = System.getProperty("line.separator");
/** formats in reverse order */
private String formatMessages(List<String> msgs) {
if (msgs.isEmpty())
......@@ -55,6 +57,11 @@ public class LogsHelper extends HelperBase {
for (int i = msgs.size(); i > 0; i--) {
String msg = msgs.get(i - 1);
msg = msg.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;");
// remove last \n that LogRecordFormatter added
if (msg.endsWith(NL))
msg = msg.substring(0, msg.length() - NL.length());
// replace \n so that exception stack traces will format correctly and will paste nicely into pastebin
msg = msg.replace("\n", "<br>&nbsp;&nbsp;&nbsp;&nbsp;\n");
buf.append("<li>");
if (colorize) {
String color;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment