[logback-dev] svn commit: r1411 - in logbackPDE/trunk/plugins/ConsolePlugin: . src/main/java/ch/qos/logback/eclipse/model

noreply.seb at qos.ch noreply.seb at qos.ch
Wed Mar 7 15:26:13 CET 2007


Author: seb
Date: Wed Mar  7 15:26:13 2007
New Revision: 1411

Modified:
   logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/model/LoggingEventManager.java
   logbackPDE/trunk/plugins/ConsolePlugin/todo.txt

Log:
Refactored sending of events
Updated todo list

Modified: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/model/LoggingEventManager.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/model/LoggingEventManager.java	(original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/model/LoggingEventManager.java	Wed Mar  7 15:26:13 2007
@@ -95,24 +95,7 @@
       return;
     }
     
-    scheduledExecutorService = Executors.newScheduledThreadPool(2);
-    
-    Runnable runnnable = new Runnable() {
-
-      int tmpIndex = lastSentIndex + 1;
-      
-      public void run() {
-        if (tmpIndex >= loggingEventList.size()) {
-          scheduledExecutorService.shutdownNow();
-        }
-        LoggingEvent event = loggingEventList.get(tmpIndex);
-        sendEvent(event);
-        tmpIndex++;
-      }
-    };
-    
-    scheduledExecutorService.scheduleAtFixedRate(runnnable,
-        0, 1, TimeUnit.MILLISECONDS);
+    sendEventsFromIndex(lastSentIndex + 1);
   }
   
   private void listSizeCheck() {
@@ -123,12 +106,21 @@
   }
   
   public void reSendAllEvents() {
+    sendEventsFromIndex(0);
+  }
+  
+  public void clearEventList() {
+    loggingEventList.clear();
+    lastSentIndex = 0;
+  }
+  
+  private void sendEventsFromIndex(final int index) {
     scheduledExecutorService = Executors.newScheduledThreadPool(2);
-
+    
     Runnable runnnable = new Runnable() {
 
-      int tmpIndex = 0;
-
+      int tmpIndex = index;
+      
       public void run() {
         if (tmpIndex >= loggingEventList.size()) {
           scheduledExecutorService.shutdownNow();
@@ -140,11 +132,6 @@
     };
     
     scheduledExecutorService.scheduleAtFixedRate(runnnable,
-        0, 1, TimeUnit.MILLISECONDS);
-  }
-  
-  public void clearEventList() {
-    loggingEventList.clear();
-    lastSentIndex = 0;
+        0, 1, TimeUnit.MICROSECONDS);
   }
 }

Modified: logbackPDE/trunk/plugins/ConsolePlugin/todo.txt
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/todo.txt	(original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/todo.txt	Wed Mar  7 15:26:13 2007
@@ -8,13 +8,11 @@
 
 Color certains lines. Based on keywords and colors?
 
-Autoscroll use with double-buffer and stop the filling of the console when auto scroll = off
-
-Use Cyclic Buffer to allow the user to change the pattern used to display the events. When the pattern
-is changed, we clear the console and re-enter the events contained in the buffer with the new pattern.
-
 DONE:
 Allow the user to change the socket's port
 Make the viewer always display the latest lines added
 Filter logs: threshold
-Save Preferences between sessions
\ No newline at end of file
+Save Preferences between sessions
+Use Cyclic Buffer to allow the user to change the pattern used to display the events. When the pattern
+is changed, we clear the console and re-enter the events contained in the buffer with the new pattern.
+Autoscroll use with double-buffer and stop the filling of the console when auto scroll = off



More information about the logback-dev mailing list