[logback-dev] svn commit: r1455 - in logbackPDE/trunk/plugins/ConsolePlugin: . META-INF lib src/main/java/ch/qos/logback/eclipse/dialog src/main/java/ch/qos/logback/eclipse/model src/main/java/ch/qos/logback/eclipse/reciever src/main/java/ch/qos/logback/eclipse/views

noreply.seb at qos.ch noreply.seb at qos.ch
Fri Mar 23 15:01:35 CET 2007


Author: seb
Date: Fri Mar 23 15:01:35 2007
New Revision: 1455

Added:
   logbackPDE/trunk/plugins/ConsolePlugin/lib/logback-classic-0.9.3.jar   (contents, props changed)
   logbackPDE/trunk/plugins/ConsolePlugin/lib/logback-core-0.9.3.jar   (contents, props changed)
Removed:
   logbackPDE/trunk/plugins/ConsolePlugin/lib/logback-classic-0.9.1-SNAPSHOT.jar
   logbackPDE/trunk/plugins/ConsolePlugin/lib/logback-core-0.9.1-SNAPSHOT.jar
Modified:
   logbackPDE/trunk/plugins/ConsolePlugin/META-INF/MANIFEST.MF
   logbackPDE/trunk/plugins/ConsolePlugin/build.properties
   logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/dialog/LogbackFilterDialog.java
   logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/model/EventFilter.java
   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/reciever/SocketNode.java
   logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/LoggingEventContentProvider.java

Log:
Now using logback 0.9.3
Added a specific message in the error console in case of incompatible LoggingEvent 
Some filtering tweaks

Modified: logbackPDE/trunk/plugins/ConsolePlugin/META-INF/MANIFEST.MF
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/META-INF/MANIFEST.MF	(original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/META-INF/MANIFEST.MF	Fri Mar 23 15:01:35 2007
@@ -5,9 +5,9 @@
 Bundle-Version: 1.0.0
 Bundle-ClassPath: logbackPlugin.jar,
  lib/janino-2.4.3.jar,
- lib/logback-classic-0.9.1-SNAPSHOT.jar,
- lib/logback-core-0.9.1-SNAPSHOT.jar,
- lib/slf4j-api-1.3.0.jar
+ lib/slf4j-api-1.3.0.jar,
+ lib/logback-classic-0.9.3.jar,
+ lib/logback-core-0.9.3.jar
 Bundle-Activator: ch.qos.logback.eclipse.LogbackPlugin
 Bundle-Vendor: QOS.ch
 Bundle-Localization: plugin

Modified: logbackPDE/trunk/plugins/ConsolePlugin/build.properties
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/build.properties	(original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/build.properties	Fri Mar 23 15:01:35 2007
@@ -5,7 +5,7 @@
                logbackPlugin.jar,\
                lib/,\
                lib/janino-2.4.3.jar,\
-               lib/logback-classic-0.9.1-SNAPSHOT.jar,\
-               lib/logback-core-0.9.1-SNAPSHOT.jar,\
-               lib/slf4j-api-1.3.0.jar
+               lib/slf4j-api-1.3.0.jar,\
+               lib/logback-classic-0.9.3.jar,\
+               lib/logback-core-0.9.3.jar
 source.logbackPlugin.jar = src/main/java/

Added: logbackPDE/trunk/plugins/ConsolePlugin/lib/logback-classic-0.9.3.jar
==============================================================================
Binary file. No diff available.

Added: logbackPDE/trunk/plugins/ConsolePlugin/lib/logback-core-0.9.3.jar
==============================================================================
Binary file. No diff available.

Modified: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/dialog/LogbackFilterDialog.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/dialog/LogbackFilterDialog.java	(original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/dialog/LogbackFilterDialog.java	Fri Mar 23 15:01:35 2007
@@ -24,6 +24,7 @@
 
 import ch.qos.logback.classic.boolex.JaninoEventEvaluator;
 import ch.qos.logback.core.filter.EvaluatorFilter;
+import ch.qos.logback.core.spi.FilterReply;
 import ch.qos.logback.eclipse.model.EventFilter;
 import ch.qos.logback.eclipse.views.FilterContentProvider;
 
@@ -190,8 +191,8 @@
     eval.stop();
     String oldExp = eval.getExpression();
     eval.setExpression(expressionField.getText());
-    current.setOnMatch(matchField.getText());
-    current.setOnMismatch(mismatchField.getText());
+    current.setOnMatch(FilterReply.valueOf(matchField.getText()));
+    current.setOnMismatch(FilterReply.valueOf(mismatchField.getText()));
     eval.start();
     if (!eval.isStarted()) {
       eval.stop();

Modified: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/model/EventFilter.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/model/EventFilter.java	(original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/model/EventFilter.java	Fri Mar 23 15:01:35 2007
@@ -88,8 +88,8 @@
       filter = new EvaluatorFilter();
       filter.setContext(context);
       filter.setName("filter " + i);
-      filter.setOnMatch(mem.getString(TAG_ONMATCH));
-      filter.setOnMismatch(mem.getString(TAG_ONMISMATCH));
+      filter.setOnMatch(FilterReply.valueOf(mem.getString(TAG_ONMATCH)));
+      filter.setOnMismatch(FilterReply.valueOf(mem.getString(TAG_ONMISMATCH)));
       eval = new JaninoEventEvaluator();
       eval.setContext(context);
       eval.setName("Eval " + i);

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	Fri Mar 23 15:01:35 2007
@@ -35,11 +35,10 @@
     return manager;
   }
   
-  public List<LoggingEvent> getAllEvents() {
-    return loggingEventList;
-  }
-
   public void addLoggingEvent(LoggingEvent event) {
+    if (!EventFilter.filter(event)) {
+      return;
+    }
     loggingEventList.add(event);
     listSizeCheck();
     if (sendingEvents) {

Modified: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/reciever/SocketNode.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/reciever/SocketNode.java	(original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/reciever/SocketNode.java	Fri Mar 23 15:01:35 2007
@@ -2,6 +2,7 @@
 
 import java.io.BufferedInputStream;
 import java.io.IOException;
+import java.io.InvalidClassException;
 import java.io.ObjectInputStream;
 import java.net.Socket;
 
@@ -39,11 +40,15 @@
       while (true) {
         // read an event from the wire
         event = (LoggingEvent) ois.readObject();
-        //trick to keep the original thread name
+        // trick to keep the original thread name
         event.getThreadName();
-        //add it to the manager's LoggingEvent list
+        // add it to the manager's LoggingEvent list
         LoggingEventManager.getManager().addLoggingEvent(event);
       }
+    } catch (ClassNotFoundException e) {
+      printVersionError(e);
+    } catch (InvalidClassException e) {
+      printVersionError(e);
     } catch (java.io.EOFException e) {
       PluginLogger.logInfo("Caught java.io.EOFException closing connection.");
     } catch (java.net.SocketException e) {
@@ -53,11 +58,19 @@
     } catch (Exception e) {
       PluginLogger.logError("Unexpected exception. Closing connection.", e);
     }
-
     try {
       ois.close();
     } catch (Exception e) {
       PluginLogger.logError("Could not close connection.", e);
     }
   }
+  
+  private void printVersionError(Exception e) {
+    String message = "There was an error trying to deserialize LoggingEvent. " +
+                "You might want to check the version number of logback. " + 
+                "This plugin works with logback version 0.9.3. If you have a different " + 
+                "version, please check if the plugin needs to be updated.";
+    PluginLogger.logError(message, e);
+  }
+  
 }

Modified: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/LoggingEventContentProvider.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/LoggingEventContentProvider.java	(original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/LoggingEventContentProvider.java	Fri Mar 23 15:01:35 2007
@@ -5,6 +5,7 @@
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.swt.widgets.Display;
 
+import ch.qos.logback.classic.spi.LoggingEvent;
 import ch.qos.logback.eclipse.model.LoggingEventManager;
 import ch.qos.logback.eclipse.model.LoggingEventManagerEvent;
 import ch.qos.logback.eclipse.model.LoggingEventManagerListener;
@@ -69,6 +70,7 @@
   }
 
   public void updateElement(int index) {
-    viewer.replace(LoggingEventManager.getManager().getEvent(index), index);
+    LoggingEvent event = LoggingEventManager.getManager().getEvent(index); 
+    viewer.replace(event, index);
   }
 }



More information about the logback-dev mailing list