forked from I2P_Developers/i2p.i2p
* logs.jsp: Format multiline messages better
This commit is contained in:
@@ -44,6 +44,8 @@ public class LogsHelper extends HelperBase {
|
|||||||
}
|
}
|
||||||
******/
|
******/
|
||||||
|
|
||||||
|
private final static String NL = System.getProperty("line.separator");
|
||||||
|
|
||||||
/** formats in reverse order */
|
/** formats in reverse order */
|
||||||
private String formatMessages(List<String> msgs) {
|
private String formatMessages(List<String> msgs) {
|
||||||
if (msgs.isEmpty())
|
if (msgs.isEmpty())
|
||||||
@@ -55,6 +57,11 @@ public class LogsHelper extends HelperBase {
|
|||||||
for (int i = msgs.size(); i > 0; i--) {
|
for (int i = msgs.size(); i > 0; i--) {
|
||||||
String msg = msgs.get(i - 1);
|
String msg = msgs.get(i - 1);
|
||||||
msg = msg.replace("&", "&").replace("<", "<").replace(">", ">");
|
msg = msg.replace("&", "&").replace("<", "<").replace(">", ">");
|
||||||
|
// 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> \n");
|
||||||
buf.append("<li>");
|
buf.append("<li>");
|
||||||
if (colorize) {
|
if (colorize) {
|
||||||
String color;
|
String color;
|
||||||
|
Reference in New Issue
Block a user