logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r954477 - in /logging/chainsaw/trunk/src/main: java/org/apache/log4j/chainsaw/ resources/org/apache/log4j/chainsaw/help/
Date Mon, 14 Jun 2010 13:47:27 GMT
Author: sdeboy
Date: Mon Jun 14 13:47:27 2010
New Revision: 954477

URL: http://svn.apache.org/viewvc?rev=954477&view=rev
Log:
Added ability to ignore a (possibly compound) expression, similar to ignoring loggers (available
in the logger tree below hidden loggers).  Ignored expression is persisted on a per-tab basis.

Modified:
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawConstants.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ExpressionRuleContext.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanelPreferenceModel.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/ChainsawConstants.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawConstants.java?rev=954477&r1=954476&r2=954477&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawConstants.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawConstants.java
Mon Jun 14 13:47:27 2010
@@ -39,6 +39,8 @@ public class ChainsawConstants {
   public static final Color FIND_LOGGER_BACKGROUND = new Color(213, 226, 235);
   public static final Color FIND_LOGGER_FOREGROUND = Color.BLACK;
 
+  public static final Color INVALID_EXPRESSION_BACKGROUND = new Color(251, 186, 186);
+
   public static final Color COLOR_ODD_ROW_BACKGROUND = new Color(227, 227, 227);
   public static final Color COLOR_ODD_ROW_FOREGROUND = Color.BLACK;
 

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ExpressionRuleContext.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ExpressionRuleContext.java?rev=954477&r1=954476&r2=954477&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ExpressionRuleContext.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ExpressionRuleContext.java
Mon Jun 14 13:47:27 2010
@@ -30,6 +30,7 @@ import javax.swing.JPopupMenu;
 import javax.swing.JScrollPane;
 import javax.swing.JTextField;
 import javax.swing.ListModel;
+import javax.swing.text.JTextComponent;
 
 import org.apache.log4j.chainsaw.filter.FilterModel;
 import org.apache.log4j.rule.RuleFactory;
@@ -48,14 +49,14 @@ public class ExpressionRuleContext exten
   JList list = new JList();
   FilterModel filterModel;
   JScrollPane scrollPane = new JScrollPane(list);
-  final JTextField textField;
+  final JTextComponent textComponent;
   private DefaultListModel fieldModel = new DefaultListModel();
   private DefaultListModel operatorModel = new DefaultListModel();
 
   public ExpressionRuleContext(
-    final FilterModel filterModel, final JTextField textField) {
+    final FilterModel filterModel, final JTextComponent textComponent) {
     this.filterModel = filterModel;
-    this.textField = textField;
+    this.textComponent = textComponent;
     fieldModel.addElement("LOGGER");
     fieldModel.addElement("LEVEL");
     fieldModel.addElement("CLASS");
@@ -86,7 +87,7 @@ public class ExpressionRuleContext exten
     list.setVisibleRowCount(13);
 
     PopupListener popupListener = new PopupListener();
-    textField.addMouseListener(popupListener);
+    textComponent.addMouseListener(popupListener);
 
     list.addKeyListener(
       new KeyAdapter() {
@@ -124,13 +125,13 @@ public class ExpressionRuleContext exten
   }
 
   private void updateField(String value) {
-    if (textField.getSelectedText() == null) {
+    if (textComponent.getSelectedText() == null) {
         if (!(value.endsWith("."))) {
             value = value + " ";
         }
     }
 
-    textField.replaceSelection(value);
+    textComponent.replaceSelection(value);
   }
 
   public void keyPressed(KeyEvent e) {
@@ -152,40 +153,40 @@ public class ExpressionRuleContext exten
       list.setModel(model);
       list.setSelectedIndex(0);
 
-      Point p = textField.getCaret().getMagicCaretPosition();
+      Point p = textComponent.getCaret().getMagicCaretPosition();
       contextMenu.doLayout();
-      contextMenu.show(textField, p.x, (p.y + (textField.getHeight() - 5)));
+      contextMenu.show(textComponent, p.x, (p.y + (textComponent.getHeight() - 5)));
       list.requestFocus();
     } else {
       if (isOperatorContextValid()) {
         list.setModel(operatorModel);
         list.setSelectedIndex(0);
 
-        Point p = textField.getCaret().getMagicCaretPosition();
+        Point p = textComponent.getCaret().getMagicCaretPosition();
         contextMenu.doLayout();
-        contextMenu.show(textField, p.x, (p.y + (textField.getHeight() - 5)));
+        contextMenu.show(textComponent, p.x, (p.y + (textComponent.getHeight() - 5)));
         list.requestFocus();
       } else if (isFieldContextValid()) {
         list.setModel(fieldModel);
         list.setSelectedIndex(0);
 
-        Point p = textField.getCaret().getMagicCaretPosition();
+        Point p = textComponent.getCaret().getMagicCaretPosition();
 
         if (p == null) {
           p = new Point(
-              textField.getLocation().x,
-              (textField.getLocation().y - textField.getHeight() + 5));
+              textComponent.getLocation().x,
+              (textComponent.getLocation().y - textComponent.getHeight() + 5));
         }
         contextMenu.doLayout();
-        contextMenu.show(textField, p.x, (p.y + (textField.getHeight() - 5)));
+        contextMenu.show(textComponent, p.x, (p.y + (textComponent.getHeight() - 5)));
         list.requestFocus();
       }
     }
   }
 
   private boolean isFieldContextValid() {
-    String text = textField.getText();
-    int currentPosition = textField.getSelectionStart();
+    String text = textComponent.getText();
+    int currentPosition = textComponent.getSelectionStart();
 
     return ((currentPosition == 0)
     || (text.charAt(currentPosition - 1) == ' '));
@@ -202,9 +203,9 @@ public class ExpressionRuleContext exten
   }
 
   private boolean isOperatorContextValid() {
-    String text = textField.getText();
+    String text = textComponent.getText();
 
-    int currentPosition = textField.getSelectionStart();
+    int currentPosition = textComponent.getSelectionStart();
 
     if ((currentPosition < 1) || (text.charAt(currentPosition - 1) != ' ')) {
       return false;
@@ -233,9 +234,9 @@ public class ExpressionRuleContext exten
   //the field returned is the left hand portion of an expression (for example, logger ==
)
   //logger is the field that is returned
   private String getField() {
-    String text = textField.getText();
+    String text = textComponent.getText();
 
-    int currentPosition = textField.getSelectionStart();
+    int currentPosition = textComponent.getSelectionStart();
 
     if ((currentPosition < 1) || (text.charAt(currentPosition - 1) != ' ')) {
       return null;
@@ -273,8 +274,8 @@ public class ExpressionRuleContext exten
   //subfields allow the key portion of a field to provide context menu support
   //and are available after the fieldname and a . (for example, PROP.)
   private String getSubField() {
-    int currentPosition = textField.getSelectionStart();
-    String text = textField.getText();
+    int currentPosition = textComponent.getSelectionStart();
+    String text = textComponent.getText();
 
     if (text.substring(0, currentPosition).toUpperCase().endsWith("PROP.")) {
       return "PROP.";

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=954477&r1=954476&r2=954477&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 Mon Jun 14
13:47:27 2010
@@ -248,7 +248,6 @@ public class LogPanel extends DockablePa
   private int previousLastIndex = -1;
   private final DateFormat timestampExpressionFormat = new SimpleDateFormat(Constants.TIMESTAMP_RULE_FORMAT);
   private final Logger logger = LogManager.getLogger(LogPanel.class);
-  private static final Color INVALID_EXPRESSION_BACKGROUND = new Color(251, 186, 186);
   private TableCellEditor markerCellEditor;
   private AutoFilterComboBox filterCombo;
   private JScrollPane eventsPane;
@@ -698,7 +697,7 @@ public class LogPanel extends DockablePa
      *
      */
     LogPanelLoggerTreeModel logTreeModel = new LogPanelLoggerTreeModel();
-    logTreePanel = new LoggerNameTreePanel(logTreeModel, preferenceModel, this, colorizer);
+    logTreePanel = new LoggerNameTreePanel(logTreeModel, preferenceModel, this, colorizer,
filterModel);
     logTreePanel.addPropertyChangeListener("searchExpression", new PropertyChangeListener()
     {
         public void propertyChange(PropertyChangeEvent evt)
@@ -1055,7 +1054,7 @@ public class LogPanel extends DockablePa
                   //don't add expressions that aren't valid
                   //invalid expression, change background of the field
                   filterText.setToolTipText(iae.getMessage());
-                  filterText.setBackground(INVALID_EXPRESSION_BACKGROUND);
+                  filterText.setBackground(ChainsawConstants.INVALID_EXPRESSION_BACKGROUND);
                 return;
               }
             }
@@ -1865,6 +1864,7 @@ public class LogPanel extends DockablePa
     }
 
     logTreePanel.ignore(preferenceModel.getHiddenLoggers());
+    logTreePanel.setHiddenExpression(preferenceModel.getHiddenExpression());
 
     //attempt to load color settings - no need to URL encode the identifier
     colorizer.loadColorSettings(identifier);
@@ -1882,6 +1882,7 @@ public class LogPanel extends DockablePa
               .getSettingsDirectory(), URLEncoder.encode(identifier) + ".xml");
 
     preferenceModel.setHiddenLoggers(new HashSet(logTreePanel.getHiddenSet()));
+    preferenceModel.setHiddenExpression(logTreePanel.getHiddenExpression());
     List visibleOrder = new ArrayList();
     Enumeration cols = table.getColumnModel().getColumns();
     while (cols.hasMoreElements()) {
@@ -2149,7 +2150,7 @@ public class LogPanel extends DockablePa
         statusBar.setSearchMatchCount(currentSearchMatchCount, getIdentifier());
       } catch (IllegalArgumentException re) {
         findField.setToolTipText(re.getMessage());
-        findField.setBackground(INVALID_EXPRESSION_BACKGROUND);
+        findField.setBackground(ChainsawConstants.INVALID_EXPRESSION_BACKGROUND);
         colorizer.setFindRule(null);
         tableModel.updateEventsWithFindRule(null);
         currentSearchMatchCount = 0;
@@ -2884,7 +2885,7 @@ public class LogPanel extends DockablePa
         } catch (IllegalArgumentException iae) {
           //invalid expression, change background of the field
           filterText.setToolTipText(iae.getMessage());
-          filterText.setBackground(INVALID_EXPRESSION_BACKGROUND);
+          filterText.setBackground(ChainsawConstants.INVALID_EXPRESSION_BACKGROUND);
         }
       }
     }

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanelPreferenceModel.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanelPreferenceModel.java?rev=954477&r1=954476&r2=954477&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanelPreferenceModel.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanelPreferenceModel.java
Mon Jun 14 13:47:27 2010
@@ -84,6 +84,7 @@ public class LogPanelPreferenceModel imp
   private String timeZone;
   private boolean wrapMsg;
   private boolean highlightSearchMatchText;
+  private String hiddenExpression;
 
     /**
    * Returns an <b>unmodifiable</b> list of the columns.
@@ -237,6 +238,7 @@ public class LogPanelPreferenceModel imp
     
     setVisibleColumns(model.getVisibleColumns());
     setHiddenLoggers(model.getHiddenLoggers());
+    setHiddenExpression(model.getHiddenExpression());
   }
 
   /**
@@ -452,4 +454,14 @@ public class LogPanelPreferenceModel imp
       this.timeZone = timeZone;
       propertySupport.firePropertyChange("dateFormatTimeZone", oldValue, this.timeZone);
   }
+
+  public void setHiddenExpression(String hiddenExpression) {
+    Object oldValue = this.hiddenExpression;
+    this.hiddenExpression = hiddenExpression;
+    propertySupport.firePropertyChange("hiddenExpression", oldValue, this.hiddenExpression);
+  }
+
+  public String getHiddenExpression() {
+    return hiddenExpression;
+  }
 }

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=954477&r1=954476&r2=954477&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
Mon Jun 14 13:47:27 2010
@@ -60,10 +60,12 @@ import javax.swing.JList;
 import javax.swing.JPanel;
 import javax.swing.JPopupMenu;
 import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
 import javax.swing.JToolBar;
 import javax.swing.JTree;
 import javax.swing.SwingUtilities;
 import javax.swing.ToolTipManager;
+import javax.swing.UIManager;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 import javax.swing.event.EventListenerList;
@@ -81,6 +83,7 @@ import javax.swing.tree.TreeSelectionMod
 import org.apache.log4j.LogManager;
 import org.apache.log4j.Logger;
 import org.apache.log4j.chainsaw.color.RuleColorizer;
+import org.apache.log4j.chainsaw.filter.FilterModel;
 import org.apache.log4j.chainsaw.icons.ChainsawIcons;
 import org.apache.log4j.chainsaw.icons.LineIconFactory;
 import org.apache.log4j.rule.AbstractRule;
@@ -131,9 +134,12 @@ final class LoggerNameTreePanel extends 
   private final LogPanelPreferenceModel preferenceModel;
 
   private final JList ignoreList = new JList();
+  private final JTextArea ignoreExpressionTextArea = new JTextArea(4, 75);
   private final JScrollPane ignoreListScroll = new JScrollPane(ignoreList);
   private final JDialog ignoreDialog = new JDialog();
+  private final JDialog ignoreExpressionDialog = new JDialog();
   private final JLabel ignoreSummary = new JLabel("0 hidden loggers");
+  private final JLabel ignoreExpressionSummary = new JLabel("Ignore expression");
   private final SmallToggleButton ignoreLoggerButton = new SmallToggleButton();
   private final EventListenerList listenerList = new EventListenerList();
   private final JTree logTree;
@@ -150,6 +156,8 @@ final class LoggerNameTreePanel extends 
   private final JToolBar toolbar = new JToolBar();
   private final LogPanel logPanel;
   private final RuleColorizer colorizer;
+  private Rule ignoreExpressionRule;
+  private FilterModel filterModel;
 
     //~ Constructors ============================================================
 
@@ -158,21 +166,27 @@ final class LoggerNameTreePanel extends 
    *
    * @param logTreeModel
    */
-  LoggerNameTreePanel(LogPanelLoggerTreeModel logTreeModel, LogPanelPreferenceModel preferenceModel,
LogPanel logPanel, RuleColorizer colorizer)
+  LoggerNameTreePanel(LogPanelLoggerTreeModel logTreeModel, LogPanelPreferenceModel preferenceModel,
LogPanel logPanel, RuleColorizer colorizer, FilterModel filterModel)
   {
     super();
     this.logTreeModel = logTreeModel;
     this.preferenceModel = preferenceModel;
     this.logPanel = logPanel;
     this.colorizer = colorizer;
+    this.filterModel = filterModel;
 
     setLayout(new BorderLayout());
+    ignoreExpressionTextArea.setLineWrap(true);
+    ignoreExpressionTextArea.setWrapStyleWord(true);
+    JTextComponentFormatter.applySystemFontAndSize(ignoreExpressionTextArea);
 
     ruleDelegate = new AbstractRule() {
     	public boolean evaluate(LoggingEvent e, Map matches)
         {
           String currentlySelectedLoggerName = getCurrentlySelectedLoggerName();
-          boolean hidden = e.getLoggerName() != null && isHidden(e.getLoggerName());
+          boolean hiddenLogger = e.getLoggerName() != null && isHiddenLogger(e.getLoggerName());
+          boolean hiddenExpression = (ignoreExpressionRule != null && ignoreExpressionRule.evaluate(e,
null));
+          boolean hidden = hiddenLogger || hiddenExpression;
           if (currentlySelectedLoggerName == null) {
           	//if there is no selected logger, pass if not hidden
           	return !hidden;
@@ -193,7 +207,9 @@ final class LoggerNameTreePanel extends 
         {
           public boolean evaluate(LoggingEvent e, Map matches)
           {
-            boolean hidden = e.getLoggerName() != null && isHidden(e.getLoggerName());
+            boolean hiddenLogger = e.getLoggerName() != null && isHiddenLogger(e.getLoggerName());
+            boolean hiddenExpression = (ignoreExpressionRule != null && ignoreExpressionRule.evaluate(e,
null));
+            boolean hidden = hiddenLogger || hiddenExpression;
             String currentlySelectedLoggerName = getCurrentlySelectedLoggerName();
 
             if (!isFocusOnSelected() && !hidden && currentlySelectedLoggerName
!= null && !"".equals(currentlySelectedLoggerName))
@@ -294,20 +310,40 @@ final class LoggerNameTreePanel extends 
 
     ignoreDialog.setTitle("Hidden/Ignored Loggers");
     ignoreDialog.setModal(true);
+
+    ignoreExpressionDialog.setTitle("Hidden/Ignored Expression");
+    ignoreExpressionDialog.setModal(true);
+
+    JPanel ignorePanel = new JPanel();
+    ignorePanel.setLayout(new BoxLayout(ignorePanel, BoxLayout.Y_AXIS));
     JPanel ignoreSummaryPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
     ignoreSummaryPanel.add(ignoreSummary);
     
     Action showIgnoreDialogAction = new AbstractAction("...") {
-
-        public void actionPerformed(ActionEvent e)
-        {
+        public void actionPerformed(ActionEvent e) {
             ignoreDialog.setVisible(true);
-        }};
+        }
+    };
+
+    Action showIgnoreExpressionDialogAction = new AbstractAction("...") {
+      public void actionPerformed(ActionEvent e) {
+        ignoreExpressionDialog.setVisible(true);
+      }
+    };
     showIgnoreDialogAction.putValue(Action.SHORT_DESCRIPTION, "Click to view and manage your
hidden/ignored loggers");
     JButton btnShowIgnoreDialog = new SmallButton(showIgnoreDialogAction);
     
     ignoreSummaryPanel.add(btnShowIgnoreDialog);
-    add(ignoreSummaryPanel, BorderLayout.SOUTH);
+    ignorePanel.add(ignoreSummaryPanel);
+
+    JPanel ignoreExpressionPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
+    ignoreExpressionPanel.add(ignoreExpressionSummary);
+    showIgnoreExpressionDialogAction.putValue(Action.SHORT_DESCRIPTION, "Click to view and
manage your hidden/ignored expression");
+    JButton btnShowIgnoreExpressionDialog = new SmallButton(showIgnoreExpressionDialogAction);
+    ignoreExpressionPanel.add(btnShowIgnoreExpressionDialog);
+
+    ignorePanel.add(ignoreExpressionPanel);
+    add(ignorePanel, BorderLayout.SOUTH);
 
     ignoreList.setModel(new DefaultListModel());
     ignoreList.addMouseListener(new MouseAdapter()
@@ -340,7 +376,24 @@ final class LoggerNameTreePanel extends 
     JPanel ignoreListPanel = new JPanel(new BorderLayout());
     ignoreListScroll.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),"Double
click an entry to unhide it"));
     ignoreListPanel.add(ignoreListScroll, BorderLayout.CENTER);
-    
+
+    JPanel ignoreExpressionDialogPanel = new JPanel(new BorderLayout());
+    ignoreExpressionTextArea.addKeyListener(new ExpressionRuleContext(filterModel, ignoreExpressionTextArea));
+
+    ignoreExpressionDialogPanel.add(new JScrollPane(ignoreExpressionTextArea), BorderLayout.CENTER);
+    JButton ignoreExpressionCloseButton = new JButton(new AbstractAction("Close") {
+          public void actionPerformed(ActionEvent e)
+          {
+              String ignoreText = ignoreExpressionTextArea.getText();
+
+              if (updateIgnoreExpression(ignoreText)) {
+                ignoreExpressionDialog.setVisible(false);
+              }
+          }});
+    JPanel closePanel = new JPanel();
+    closePanel.add(ignoreExpressionCloseButton);
+    ignoreExpressionDialogPanel.add(closePanel, BorderLayout.SOUTH);
+
     Box ignoreListButtonPanel = Box.createHorizontalBox();
     
     JButton unhideAll = new JButton(new AbstractAction("Unhide All") {
@@ -373,9 +426,32 @@ final class LoggerNameTreePanel extends 
     
     ignoreDialog.getContentPane().add(ignoreListPanel);
     ignoreDialog.pack();
+
+    ignoreExpressionDialog.getContentPane().add(ignoreExpressionDialogPanel);
+    ignoreExpressionDialog.pack();
   }
 
-  //~ Methods =================================================================
+    private boolean updateIgnoreExpression(String ignoreText)
+    {
+        try {
+            if (ignoreText != null && !ignoreText.trim().equals("")) {
+                ignoreExpressionRule = ExpressionRule.getRule(ignoreText);
+            } else {
+                ignoreExpressionRule = null;
+            }
+            firePropertyChange("hiddenSet", null, null);
+
+            updateAllIgnoreStuff();
+            ignoreExpressionTextArea.setBackground(UIManager.getColor("TextField.background"));
+            return true;
+        } catch (IllegalArgumentException iae) {
+            ignoreExpressionTextArea.setToolTipText(iae.getMessage());
+            ignoreExpressionTextArea.setBackground(ChainsawConstants.INVALID_EXPRESSION_BACKGROUND);
+            return false;
+        }
+    }
+
+    //~ Methods =================================================================
 
   /**
    * Adds a change Listener to this LoggerNameTreePanel to be notfied
@@ -444,7 +520,7 @@ final class LoggerNameTreePanel extends 
     }
   }
 
-  private boolean isHidden(String loggerName) {
+  private boolean isHiddenLogger(String loggerName) {
     for (Iterator iter = hiddenSet.iterator();iter.hasNext();) {
       String hiddenLoggerEntry = iter.next().toString();
       if (loggerName.startsWith(hiddenLoggerEntry + ".") || loggerName.endsWith(hiddenLoggerEntry))
{
@@ -1342,6 +1418,7 @@ final class LoggerNameTreePanel extends 
   private void updateAllIgnoreStuff() {
       updateHiddenSetModels();
       updateIgnoreSummary();
+      updateIgnoreExpressionSummary();
   }
   
   private void updateHiddenSetModels() {
@@ -1362,6 +1439,10 @@ final class LoggerNameTreePanel extends 
   private void updateIgnoreSummary() {
       ignoreSummary.setText(ignoreList.getModel().getSize() + " hidden loggers");
   }
+
+  private void updateIgnoreExpressionSummary() {
+    ignoreExpressionSummary.setText(ignoreExpressionRule != null?"Ignore expression (set)":"Ignore
expression (unset)");
+  }
   
   private void toggleFocusOnState()
   {
@@ -1373,6 +1454,19 @@ final class LoggerNameTreePanel extends 
         return Collections.unmodifiableSet(hiddenSet);
     }
 
+    public String getHiddenExpression() {
+        String text = ignoreExpressionTextArea.getText();
+        if (text == null || text.trim().equals("")) {
+            return null;
+        }
+        return text.trim();
+    }
+
+    public void setHiddenExpression(String hiddenExpression) {
+        ignoreExpressionTextArea.setText(hiddenExpression);
+        updateIgnoreExpression(hiddenExpression);
+    }
+
     //~ 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=954477&r1=954476&r2=954477&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
Mon Jun 14 13:47:27 2010
@@ -14,6 +14,7 @@
 <ul>
 <li>When mouse is moved into the thumbnail bar, event details for the closest event
w/a color rule or search match is displayed as a tooltip (enabled by default, configurable
via Tab Preferences dialog, Visuals section).</li>
 <li>If the 'You have no Receivers defined' dialog is displayed, a configuration URL
is provided and the 'don't show me this again' checkbox is selected, the provided configuration
URL is set as the Auto Config URL in application-wide preferences and used from then on when
Chainsaw starts.</li>
+<li>Added ability to ignore a (possibly compound) expression, similar to ignoring loggers
(available in the logger tree below hidden loggers).  Ignored expression is persisted on a
per-tab basis.</li>
 </ul>
 <h2>11 Jun 2010</h2>
 <ul>



Mime
View raw message