diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/LogsHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/LogsHelper.java index b0a46db93..6c6a379ba 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/LogsHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/LogsHelper.java @@ -32,7 +32,14 @@ public class LogsHelper extends HelperBase { private static final int MAX_WRAPPER_LINES = 250; private static final String PROP_LAST_WRAPPER = "routerconsole.lastWrapperLogEntry"; - + // Homeland Security Advisory System + // http://www.dhs.gov/xinfoshare/programs/Copy_of_press_release_0046.shtm + // but pink instead of yellow for WARN + private static final String COLOR_CRIT = "#cc0000"; + private static final String COLOR_ERROR = "#ff3300"; + private static final String COLOR_WARN = "#bf00df"; + private static final String COLOR_INFO = "#333399"; + private static final String COLOR_DEBUG = "#006600"; /** @since 0.8.12 */ public String getJettyVersion() { @@ -311,35 +318,35 @@ public class LogsHelper extends HelperBase { if ("crit".equals(filter)) buf.append("" + tCRIT + " (" + crits + ")"); else - buf.append("" + tCRIT + " (" + crits + ")"); + buf.append("" + tCRIT + " (" + crits + ")"); buf.append(" \n"); } if (errors > 0) { if ("error".equals(filter)) buf.append("" + tERROR + " (" + errors + ")"); else - buf.append("" + tERROR + " (" + errors + ")"); + buf.append("" + tERROR + " (" + errors + ")"); buf.append(" \n"); } if (warns > 0) { if ("warn".equals(filter)) buf.append("" + tWARN + " (" + warns + ")"); else - buf.append("" + tWARN + " (" + warns + ")"); + buf.append("" + tWARN + " (" + warns + ")"); buf.append(" \n"); } if (infos > 0) { if ("info".equals(filter)) - buf.append("" + tINFO + " (" + infos + ")"); + buf.append("" + tINFO + "< (" + infos + ")"); else - buf.append("" + tINFO + " (" + infos + ")"); + buf.append("" + tINFO + " (" + infos + ")"); buf.append(" \n"); } if (debugs > 0) { if ("debug".equals(filter)) buf.append("" + tDEBUG + " (" + debugs + ")"); else - buf.append("" + tDEBUG + " (" + debugs + ")"); + buf.append("" + tDEBUG + " (" + debugs + ")"); buf.append(" \n"); } if (filter != null) { @@ -377,31 +384,27 @@ public class LogsHelper extends HelperBase { if (colorize) { // TODO this would be a lot easier if LogConsoleBuffer stored LogRecords instead of formatted strings String color; - // Homeland Security Advisory System - // http://www.dhs.gov/xinfoshare/programs/Copy_of_press_release_0046.shtm - // but pink instead of yellow for WARN if (msg.contains(tCRIT)) { if (filter != null && !filter.equals("crit")) continue; - color = "#cc0000"; + color = COLOR_CRIT; } else if (msg.contains(tERROR)) { if (filter != null && !filter.equals("error")) continue; - color = "#ff3300"; + color = COLOR_ERROR; } else if (msg.contains(tWARN)) { - // color = "#ff00cc"; poor legibility on light backgrounds if (filter != null && !filter.equals("warn")) continue; - color = "#bf00df"; + color = COLOR_WARN; } else if (msg.contains(tINFO)) { if (filter != null && !filter.equals("info")) continue; - color = "#333399"; + color = COLOR_INFO; } else { // skip the "similar messages" lines when filtering if (filter != null && (!filter.equals("debug") || msg.contains("↑↑↑"))) continue; - color = "#006600"; + color = COLOR_DEBUG; } buf.append("