Permalink
Browse files

adding debug output

  • Loading branch information...
1 parent 932c170 commit 03340fb28b011bc18c368405d2f5c3a4e79e79fb @johann8384 committed Apr 13, 2012
Showing with 35 additions and 0 deletions.
  1. +35 −0 src/main/java/com/admob/rocksteady/reactor/Console.java
@@ -0,0 +1,35 @@
+package com.admob.rocksteady.reactor;
+
+import org.slf4j.Logger;
+
+import org.slf4j.LoggerFactory;
+import com.espertech.esper.client.EventBean;
+import com.espertech.esper.client.UpdateListener;
+
+public class Console implements UpdateListener {
+ private static final Logger logger = LoggerFactory
+ .getLogger(Alerting.class);
+
+ @Override
+ public void update(EventBean[] newEvents, EventBean[] oldEvents) {
+ // TODO Auto-generated method stub
+ if (newEvents == null) {
+ return;
+ }
+
+ Integer i = 0;
+
+ for (EventBean newEvent : newEvents) {
+ i++;
+ try {
+ String msg = "";
+ msg += newEvent.toString();
+ logger.info(msg);
+ } catch (Exception e) {
+ logger.error("Error: " + newEvent.toString() + " - " + e.getMessage());
+ }
+
+ }
+ }
+
+}

0 comments on commit 03340fb

Please sign in to comment.