logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r982114 - in /logging/chainsaw/trunk/src/main: java/org/apache/log4j/chainsaw/ resources/org/apache/log4j/chainsaw/help/
Date Wed, 04 Aug 2010 04:06:41 GMT
Author: sdeboy
Date: Wed Aug  4 04:06:40 2010
New Revision: 982114

URL: http://svn.apache.org/viewvc?rev=982114&view=rev
Log:
Feature suggestion - clear the logger tree when events are cleared

Modified:
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawCyclicBufferTableModel.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanelLoggerTreeModel.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameListener.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameModel.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameModelSupport.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameTreePanel.java
    logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/release-notes.html

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawCyclicBufferTableModel.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawCyclicBufferTableModel.java?rev=982114&r1=982113&r2=982114&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawCyclicBufferTableModel.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawCyclicBufferTableModel.java
Wed Aug  4 04:06:40 2010
@@ -227,6 +227,10 @@ class ChainsawCyclicBufferTableModel ext
     return loggerNameModelDelegate.addLoggerName(loggerName);
   }
 
+  public void reset() {
+      loggerNameModelDelegate.reset();
+  }
+
   /**
    * @param l
    */
@@ -349,6 +353,7 @@ class ChainsawCyclicBufferTableModel ext
     });
 
     notifyCountListeners();
+    loggerNameModelDelegate.reset();
   }
 
   public List getAllEvents() {

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java?rev=982114&r1=982113&r2=982114&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java (original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java Wed Aug 
4 04:06:40 2010
@@ -727,6 +727,7 @@ public class LogPanel extends DockablePa
     });
       
     tableModel.addLoggerNameListener(logTreeModel);
+    tableModel.addLoggerNameListener(logTreePanel);
 
     /**
      * Set the LoggerRule to be the LoggerTreePanel, as this visual component

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanelLoggerTreeModel.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanelLoggerTreeModel.java?rev=982114&r1=982113&r2=982114&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanelLoggerTreeModel.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanelLoggerTreeModel.java
Wed Aug  4 04:06:40 2010
@@ -62,6 +62,13 @@ class LogPanelLoggerTreeModel extends De
       });
   }
 
+  public void reset() {
+      DefaultMutableTreeNode current = (DefaultMutableTreeNode) getRoot();
+      current.removeAllChildren();
+      fullPackageMap.clear();
+      nodeStructureChanged(current);
+  }
+
   private void addLoggerNameInDispatchThread(final String loggerName) {
     String[] packages = tokenize(loggerName);
 

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameListener.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameListener.java?rev=982114&r1=982113&r2=982114&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameListener.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameListener.java
Wed Aug  4 04:06:40 2010
@@ -33,4 +33,9 @@ public interface LoggerNameListener exte
    * @param loggerName the new, unique loggerName
    */
   public void loggerNameAdded(String loggerName);
+
+  /**
+   * Logger names were reset (used to clear the tree model)
+   */
+  public void reset();
 }

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameModel.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameModel.java?rev=982114&r1=982113&r2=982114&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameModel.java (original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameModel.java Wed
Aug  4 04:06:40 2010
@@ -49,6 +49,11 @@ public interface LoggerNameModel {
    * @param loggerName
    */
   public boolean addLoggerName(String loggerName);
+
+  /**
+   * The logger names have been cleared
+   */
+  public void reset();
   
   public void addLoggerNameListener(LoggerNameListener l);
   public void removeLoggerNameListener(LoggerNameListener l);

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameModelSupport.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameModelSupport.java?rev=982114&r1=982113&r2=982114&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameModelSupport.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameModelSupport.java
Wed Aug  4 04:06:40 2010
@@ -59,6 +59,17 @@ public class LoggerNameModelSupport impl
     return isNew;
   }
 
+  public void reset() {
+      loggerNameSet.clear();
+      LoggerNameListener[] eventListeners = (LoggerNameListener[]) listenerList.getListeners(LoggerNameListener.class);
+
+      for (int i = 0; i < eventListeners.length; i++)
+      {
+        LoggerNameListener listener = eventListeners[i];
+        listener.reset();
+      }
+  }
+
   /**
    * Notifies all the registered listeners that a new unique
    * logger name has been added to this model

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameTreePanel.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameTreePanel.java?rev=982114&r1=982113&r2=982114&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameTreePanel.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameTreePanel.java
Wed Aug  4 04:06:40 2010
@@ -101,7 +101,7 @@ import org.apache.log4j.spi.LoggingEvent
  *
  * @author Paul Smith <psmith@apache.org>
  */
-final class LoggerNameTreePanel extends JPanel
+final class LoggerNameTreePanel extends JPanel implements LoggerNameListener
 {
   //~ Static fields/initializers ==============================================
 
@@ -159,6 +159,7 @@ final class LoggerNameTreePanel extends 
   private final RuleColorizer colorizer;
   private Rule ignoreExpressionRule;
   private FilterModel filterModel;
+  private boolean expandRootLatch = false;
 
     //~ Constructors ============================================================
 
@@ -229,18 +230,16 @@ final class LoggerNameTreePanel extends 
     //	============================================
     logTreeModel.addTreeModelListener(new TreeModelListener()
       {
-        private boolean latched = false;
-
         public void treeNodesChanged(TreeModelEvent e)
         {
         }
 
         public void treeNodesInserted(TreeModelEvent e)
         {
-          if (!latched)
+          if (!expandRootLatch)
           {
             ensureRootExpanded();
-            latched = true;
+            expandRootLatch = true;
           }
         }
 
@@ -1452,6 +1451,16 @@ final class LoggerNameTreePanel extends 
         updateIgnoreExpression(hiddenExpression);
     }
 
+    public void loggerNameAdded(String loggerName)
+    {
+        //no-op
+    }
+
+    public void reset()
+    {
+        expandRootLatch = false;
+    }
+
     //~ Inner Classes ===========================================================
 
   /**

Modified: logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/release-notes.html
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/release-notes.html?rev=982114&r1=982113&r2=982114&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/release-notes.html
(original)
+++ logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/release-notes.html
Wed Aug  4 04:06:40 2010
@@ -10,6 +10,10 @@
 <b>NOTE:</b> The mechanism and format used to persist settings in Chainsaw is
subject to change.  If you are experiencing problems displaying events in Chainsaw, please
delete everything in the $user.dir/.chainsaw directory and restart Chainsaw.
 <br>
 <h1>2.1</h1>
+<h2>3 Aug 2010</h2>
+<ul>
+<li>Now clearing the logger name tree when the table is cleared.</li>
+</ul>
 <h2>21 Jul 2010</h2>
 <ul>
 <li>Rewrote initial configuration screen with new ability to define a file receiver
from the dialog (and provide a PatternLayout as the format) </li>



Mime
View raw message