accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject git commit: ACCUMULO-1509 - Appling Luke Brassard's highlighting patch
Date Fri, 25 Oct 2013 22:46:08 GMT
Updated Branches:
  refs/heads/master 9e32d86ec -> 0a3de4762


ACCUMULO-1509 - Appling Luke Brassard's highlighting patch


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/0a3de476
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/0a3de476
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/0a3de476

Branch: refs/heads/master
Commit: 0a3de476285e7d8b9f679448d73161ed509dc42d
Parents: 9e32d86
Author: John Vines <jvines@gmail.com>
Authored: Fri Oct 25 18:45:41 2013 -0400
Committer: John Vines <jvines@gmail.com>
Committed: Fri Oct 25 18:45:41 2013 -0400

----------------------------------------------------------------------
 .../server/monitor/servlets/BasicServlet.java         | 14 ++++++++++++--
 server/src/main/resources/web/screen.css              |  4 ++++
 2 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/0a3de476/server/src/main/java/org/apache/accumulo/server/monitor/servlets/BasicServlet.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/monitor/servlets/BasicServlet.java
b/server/src/main/java/org/apache/accumulo/server/monitor/servlets/BasicServlet.java
index 6e38175..81bfa4c 100644
--- a/server/src/main/java/org/apache/accumulo/server/monitor/servlets/BasicServlet.java
+++ b/server/src/main/java/org/apache/accumulo/server/monitor/servlets/BasicServlet.java
@@ -23,6 +23,7 @@ import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 import java.net.URLEncoder;
 import java.util.Date;
+import java.util.List;
 import java.util.TimerTask;
 
 import javax.servlet.ServletException;
@@ -34,9 +35,11 @@ import javax.servlet.http.HttpServletResponse;
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.server.client.HdfsZooInstance;
+import org.apache.accumulo.server.monitor.DedupedLogEvent;
 import org.apache.accumulo.server.monitor.LogService;
 import org.apache.accumulo.server.monitor.Monitor;
 import org.apache.accumulo.server.util.time.SimpleTimer;
+import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
 
 abstract public class BasicServlet extends HttpServlet {
@@ -183,9 +186,16 @@ abstract public class BasicServlet extends HttpServlet {
     sb.append("<a href='/tables'>Tables</a><br />\n");
     sb.append("<a href='/trace/summary?minutes=10'>Recent&nbsp;Traces</a><br
/>\n");
     sb.append("<a href='/docs'>Documentation</a><br />\n");
-    int numLogs = LogService.getInstance().getEvents().size();
+    List<DedupedLogEvent> dedupedLogEvents = LogService.getInstance().getEvents();
+    int numLogs = dedupedLogEvents.size();
+    boolean logsHaveError = false;
+    for (DedupedLogEvent dedupedLogEvent : dedupedLogEvents)
+      if (dedupedLogEvent.getEvent().getLevel().isGreaterOrEqual(Level.ERROR)) {
+        logsHaveError = true;
+        break;
+      }
     if (numLogs > 0)
-      sb.append("<span class='error'><a href='/log'>Recent&nbsp;Logs&nbsp;<span
class='smalltext'>(" + numLogs + ")</a></span></span><br />\n");
+      sb.append("<span class='" + (logsHaveError ? "error" : "warning") + "'><a
href='/log'>Recent&nbsp;Logs&nbsp;<span class='smalltext'>(" + numLogs +
")</a></span></span><br />\n");
     int numProblems = Monitor.getProblemSummary().entrySet().size();
     if (numProblems > 0)
       sb.append("<span class='error'><a href='/problems'>Table&nbsp;Problems&nbsp;<span
class='smalltext'>(" + numProblems + ")</a></span></span><br />\n");

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0a3de476/server/src/main/resources/web/screen.css
----------------------------------------------------------------------
diff --git a/server/src/main/resources/web/screen.css b/server/src/main/resources/web/screen.css
index 7af3af3..7aa49a0 100644
--- a/server/src/main/resources/web/screen.css
+++ b/server/src/main/resources/web/screen.css
@@ -309,6 +309,10 @@ pre.logevent {
 	background-color: #ffff33;
 }
 
+.warning a {
+	background-color: #ffff33;
+}
+
 .highlight {
 	background-color: #cef4b5;
 }


Mime
View raw message