From generaldustinhughes@example.org Sat Oct 03 06:33:57 2009 Return-Path: <generaldustinhughes@example.org> Delivered-To: dustinhughes@example.org Received: (qmail 26392 invoked from network); 3 Oct 2009 06:33:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Oct 2009 06:33:56 -0000 Received: (qmail 58862 invoked by uid 500); 3 Oct 2009 06:33:56 -0000 Delivered-To: dustinhughes@example.org Received: (qmail 58764 invoked by uid 500); 3 Oct 2009 06:33:55 -0000 Mailing-List: contact dustinhughes@example.org; run by ezmlm Precedence: bulk list-help: <mailto:dustinhughes@example.org> list-unsubscribe: <mailto:dustinhughes@example.org> List-Post: <mailto:dustinhughes@example.org> Reply-To: "Logging General" <dustinhughes@example.org> List-Id: <general.logging.apache.org> Delivered-To: mailing list dustinhughes@example.org Received: (qmail 58749 invoked by uid 99); 3 Oct 2009 06:33:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Oct 2009 06:33:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Oct 2009 06:33:52 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 01FDC238889D; Sat, 3 Oct 2009 06:33:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r821258 - in /logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw: ChainsawCyclicBufferTableModel.java LogPanel.java vfs/VFSLogFilePatternReceiver.java Date: Sat, 03 Oct 2009 06:33:30 -0000 To: dustinhughes@example.org From: dustinhughes@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <dustinhughes@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sdeboy Date: Sat Oct 3 06:33:30 2009 New Revision: 821258 URL: http://svn.apache.org/viewvc?rev=821258&view=rev Log: Chainsaw UI updates - improve event load performance by holding off on tablemodel update notification until the entire batch is processed (50K+ events loaded in just a few seconds on a fast machine) VFS/LogFilePatternReceiver changes - improve event parsing by assuming logger and level must not contain spaces - rework logFormat parsing to beter support properties (when the property name contains part of a keyword name, or vice versa: PROP(TIME), PROP(LOGGER1), etc) 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/vfs/VFSLogFilePatternReceiver.java 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=821258&r1=821257&r2=821258&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 Sat Oct 3 06:33:30 2009 @@ -511,11 +511,6 @@ } } - if (rowAdded) { - int lastAdded = getLastAdded(); - fireTableEvent(lastAdded, lastAdded, 1); - } - return rowAdded; } @@ -555,7 +550,7 @@ } /** - * @param key + * @param e */ private void fireNewKeyColumnAdded(NewKeyEvent e) { NewKeyListener[] listeners = 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=821258&r1=821257&r2=821258&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 Sat Oct 3 06:33:30 2009 @@ -711,7 +711,7 @@ table.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent evt) { if (((evt.getFirstIndex() == evt.getLastIndex()) - && (evt.getFirstIndex() > 0)) || (evt.getValueIsAdjusting())) { + && (evt.getFirstIndex() > 0) && previousLastIndex != -1) || (evt.getValueIsAdjusting())) { return; } boolean lastIndexOnLastRow = (evt.getLastIndex() == (table.getRowCount() - 1)); @@ -741,7 +741,7 @@ new ListSelectionListener() { public void valueChanged(ListSelectionEvent evt) { if (((evt.getFirstIndex() == evt.getLastIndex()) - && (evt.getFirstIndex() > 0)) || (evt.getValueIsAdjusting())) { + && (evt.getFirstIndex() > 0) && previousLastIndex != -1) || (evt.getValueIsAdjusting())) { return; } @@ -1475,8 +1475,8 @@ if (isPaused()) { return; } - final int selectedRow = table.getSelectedRow(); + final int startingRow = table.getRowCount(); final LoggingEvent selectedEvent; if (selectedRow >= 0) { selectedEvent = tableModel.getRow(selectedRow); @@ -1486,14 +1486,22 @@ boolean rowAdded = false; + int addedRowCount = 0; for (Iterator iter = events.iterator(); iter.hasNext();) { LoggingEvent event = (LoggingEvent) iter.next(); updateOtherModels(event); boolean isCurrentRowAdded = tableModel.isAddRow(event); + if (isCurrentRowAdded) { + addedRowCount++; + } rowAdded = rowAdded || isCurrentRowAdded; } + //fire after adding all events + if (rowAdded) { + tableModel.fireTableEvent(startingRow, startingRow + addedRowCount, addedRowCount); + } //tell the model to notify the count listeners tableModel.notifyCountListeners(); @@ -2195,6 +2203,7 @@ * Reset the LoggingEvent container, detail panel and status bar */ private void clearModel() { + previousLastIndex = -1; tableModel.clearModel(); synchronized (detail) { Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java?rev=821258&r1=821257&r2=821258&view=diff ============================================================================== --- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java (original) +++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java Sat Oct 3 06:33:30 2009 @@ -417,6 +417,9 @@ } catch (Error err) { getLogger().info(getPath() + " - unable to refresh fileobject", err); } + if (lastFileSize == 0) { + getLogger().info(getPath() + " - loading file"); + } //could have been truncated or appended to (don't do anything if same size) if (fileObject.getContent().getSize() < lastFileSize) { reader = new InputStreamReader(fileObject.getContent().getInputStream()); From generaldustinhughes@example.org Mon Oct 12 08:50:39 2009 Return-Path: <generaldustinhughes@example.org> Delivered-To: dustinhughes@example.org Received: (qmail 23270 invoked from network); 12 Oct 2009 08:50:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 12 Oct 2009 08:50:38 -0000 Received: (qmail 18624 invoked by uid 500); 12 Oct 2009 08:50:38 -0000 Delivered-To: dustinhughes@example.org Received: (qmail 18520 invoked by uid 500); 12 Oct 2009 08:50:38 -0000 Mailing-List: contact dustinhughes@example.org; run by ezmlm Precedence: bulk list-help: <mailto:dustinhughes@example.org> list-unsubscribe: <mailto:dustinhughes@example.org> List-Post: <mailto:dustinhughes@example.org> Reply-To: "Logging General" <dustinhughes@example.org> List-Id: <general.logging.apache.org> Delivered-To: mailing list dustinhughes@example.org Received: (qmail 18511 invoked by uid 99); 12 Oct 2009 08:50:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Oct 2009 08:50:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Oct 2009 08:50:35 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3E91B23888E3; Mon, 12 Oct 2009 08:50:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r824263 - /logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java Date: Mon, 12 Oct 2009 08:50:14 -0000 To: dustinhughes@example.org From: dustinhughes@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <dustinhughes@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sdeboy Date: Mon Oct 12 08:50:13 2009 New Revision: 824263 URL: http://svn.apache.org/viewvc?rev=824263&view=rev Log: Move VFS reader thread specific state to the reader thread inner class, fixing receiver restart issues Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java?rev=824263&r1=824262&r2=824263&view=diff ============================================================================== --- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java (original) +++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java Mon Oct 12 08:50:13 2009 @@ -169,43 +169,24 @@ */ public class VFSLogFilePatternReceiver extends LogFilePatternReceiver implements VisualReceiver { - private Reader reader; private boolean promptForUserInfo = false; private Container container; private Object waitForContainerLock = new Object(); private String password; private boolean autoReconnect; - private FileObject fileObject; + private VFSReader vfsReader; public VFSLogFilePatternReceiver() { super(); } public void shutdown() { - getLogger().info("shutdown"); + getLogger().info("shutdown VFSLogFilePatternReceiver"); active = false; container = null; - if (fileObject != null) - { - try - { - if (fileObject.exists()) { - fileObject.getContent().getInputStream().close(); - } - fileObject.close(); - } - catch (IOException e) - { - getLogger().warn("Unable to close fileObject", e); - } - } - if (reader != null) { - try { - reader.close(); - reader = null; - } catch (IOException ioe) { - getLogger().warn("Unable to close reader", ioe); - } + if (vfsReader != null) { + vfsReader.terminate(); + vfsReader = null; } } @@ -315,7 +296,8 @@ setHost(oldURL.substring(0, index + "://".length())); setPath(oldURL.substring(index + "://".length())); } - new Thread(new VFSReader()).start(); + vfsReader = new VFSReader(); + new Thread(vfsReader).start(); } }); }}).start(); @@ -331,14 +313,19 @@ setHost(oldURL.substring(0, index + "://".length())); setPath(lastPart.substring(passEndIndex + 1)); } - new Thread(new VFSReader()).start(); + vfsReader = new VFSReader(); + new Thread(vfsReader).start(); } } private class VFSReader implements Runnable { - public void run() { + private boolean terminated = false; + private Reader reader; + private FileObject fileObject; + + public void run() { //thread should end when we're no longer active - while (reader == null && isActive()) { + while (reader == null && !terminated) { int atIndex = getFileURL().indexOf("@"); int protocolIndex = getFileURL().indexOf("://"); @@ -379,7 +366,7 @@ } } } - if (!isActive()) { + if (terminated) { //shut down while waiting for a file return; } @@ -410,7 +397,7 @@ fileObject = fileSystemManager.resolveFile(getFileURL(), opts); //file may not exist.. - if (fileObject.exists()) { + if (fileObject != null && fileObject.exists()) { try { //available in vfs as of 30 Mar 2006 - will load but not tail if not available fileObject.refresh(); @@ -436,37 +423,36 @@ lastFileSize = fileObject.getContent().getSize(); rac.close(); } + try { + //release file so it can be externally deleted/renamed if necessary + fileObject.close(); + fileObject = null; + } + catch (IOException e) + { + getLogger().debug(getPath() + " - unable to close fileobject", e); + } + try { + if (reader != null) { + reader.close(); + reader = null; + } + } catch (IOException ioe) { + getLogger().debug(getPath() + " - unable to close reader", ioe); + } } else { getLogger().info(getPath() + " - not available - will re-attempt to load after waiting " + getWaitMillis() + " millis"); } try { - //release file so it can be externally deleted/renamed if necessary - fileObject.close(); - fileObject = null; - } - catch (IOException e) - { - getLogger().debug(getPath() + " - unable to close fileobject", e); - } - try { - if (reader != null) { - reader.close(); - reader = null; - } - } catch (IOException ioe) { - getLogger().debug(getPath() + " - unable to close reader", ioe); - } - - try { synchronized (this) { wait(getWaitMillis()); } } catch (InterruptedException ie) {} - if (isTailing()) { + if (isTailing() && !terminated) { getLogger().debug(getPath() + " - tailing file - file size: " + lastFileSize); } - } while (isTailing() && isActive()); + } while (isTailing() && !terminated); } catch (IOException ioe) { getLogger().info(getPath() + " - exception processing file", ioe); try { @@ -482,11 +468,15 @@ } } catch (InterruptedException ie) {} } - } while (isAutoReconnect() && isActive()); + } while (isAutoReconnect() && !terminated); getLogger().debug(getPath() + " - processing complete"); - shutdown(); } - } + + public void terminate() + { + terminated = true; + } + } public class UserNamePasswordDialog extends JDialog { private String userName; From generaldustinhughes@example.org Mon Oct 12 08:52:50 2009 Return-Path: <generaldustinhughes@example.org> Delivered-To: dustinhughes@example.org Received: (qmail 23899 invoked from network); 12 Oct 2009 08:52:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 12 Oct 2009 08:52:50 -0000 Received: (qmail 21859 invoked by uid 500); 12 Oct 2009 08:52:50 -0000 Delivered-To: dustinhughes@example.org Received: (qmail 21758 invoked by uid 500); 12 Oct 2009 08:52:49 -0000 Mailing-List: contact dustinhughes@example.org; run by ezmlm Precedence: bulk list-help: <mailto:dustinhughes@example.org> list-unsubscribe: <mailto:dustinhughes@example.org> List-Post: <mailto:dustinhughes@example.org> Reply-To: "Logging General" <dustinhughes@example.org> List-Id: <general.logging.apache.org> Delivered-To: mailing list dustinhughes@example.org Received: (qmail 21749 invoked by uid 99); 12 Oct 2009 08:52:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Oct 2009 08:52:49 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Oct 2009 08:52:47 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1D1712388897; Mon, 12 Oct 2009 08:52:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r824265 - in /logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw: ChainsawConstants.java ChainsawCyclicBufferTableModel.java ChainsawTabbedPane.java LogPanel.java LogPanelPreferenceModel.java Date: Mon, 12 Oct 2009 08:52:26 -0000 To: dustinhughes@example.org From: dustinhughes@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <dustinhughes@example.org> Author: sdeboy Date: Mon Oct 12 08:52:26 2009 New Revision: 824265 URL: http://svn.apache.org/viewvc?rev=824265&view=rev Log: Minor Chainsaw tweaks: - Avoid case-sensitive column entry mismatch issues by making all columns stored in uppercase - When a new tab is addd (which isn't the chainsaw-log tab), select the tab - Add a serialversionuid member to logpanelpreferencemodel, preventing serialization issues Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawConstants.java logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawCyclicBufferTableModel.java logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawTabbedPane.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 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=824265&r1=824264&r2=824265&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 Oct 12 08:52:26 2009 @@ -56,18 +56,18 @@ static final String SETTINGS_EXTENSION = ".settings"; //COLUMN NAMES - static final String LOGGER_COL_NAME = "Logger"; - static final String TIMESTAMP_COL_NAME = "Timestamp"; - static final String LEVEL_COL_NAME = "Level"; - static final String THREAD_COL_NAME = "Thread"; - static final String MESSAGE_COL_NAME = "Message"; + static final String LOGGER_COL_NAME = "LOGGER"; + static final String TIMESTAMP_COL_NAME = "TIMESTAMP"; + static final String LEVEL_COL_NAME = "LEVEL"; + static final String THREAD_COL_NAME = "THREAD"; + static final String MESSAGE_COL_NAME = "MESSAGE"; static final String NDC_COL_NAME = "NDC"; - static final String THROWABLE_COL_NAME = "Throwable"; - static final String CLASS_COL_NAME = "Class"; - static final String METHOD_COL_NAME = "Method"; - static final String FILE_COL_NAME = "File"; - static final String LINE_COL_NAME = "Line"; - static final String PROPERTIES_COL_NAME = "Properties"; + static final String THROWABLE_COL_NAME = "THROWABLE"; + static final String CLASS_COL_NAME = "CLASS"; + static final String METHOD_COL_NAME = "METHOD"; + static final String FILE_COL_NAME = "FILE"; + static final String LINE_COL_NAME = "LINE"; + static final String PROPERTIES_COL_NAME = "PROPERTIES"; static final String ID_COL_NAME = "ID"; //none is not a real column name, but is used by filters as a way to apply no filter for colors or display 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=824265&r1=824264&r2=824265&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 Mon Oct 12 08:52:26 2009 @@ -338,7 +338,9 @@ } public String getColumnName(int column) { - return columnNames.get(column).toString(); + //columnNames all upper, make 1st char upper & rest lower + String col = (String) columnNames.get(column); + return col.substring(0, 1).toUpperCase() + col.substring(1).toLowerCase(); } public LoggingEvent getRow(int row) { @@ -498,15 +500,16 @@ * If so, we should add them as columns and notify listeners. */ for (Iterator iter = e.getPropertyKeySet().iterator(); iter.hasNext();) { - Object key = iter.next(); + String key = iter.next().toString().toUpperCase(); - //add all keys except the 'log4jid' key - if (!columnNames.contains(key) && !(Constants.LOG4J_ID_KEY.equalsIgnoreCase(key.toString()))) { + //add all keys except the 'log4jid' key (columnNames is all-caps) + if (!columnNames.contains(key) && !(Constants.LOG4J_ID_KEY.equalsIgnoreCase(key))) { columnNames.add(key); - logger.debug("Adding col '" + key + "', columNames=" + columnNames); + logger.debug("Adding col '" + key + "', columnNames=" + columnNames); + String mixedCaseKey = key.substring(0, 1).toUpperCase() + key.substring(1).toLowerCase(); fireNewKeyColumnAdded( new NewKeyEvent( - this, columnNames.indexOf(key), key, e.getProperty(key.toString()))); + this, columnNames.indexOf(key), mixedCaseKey, e.getProperty(key))); } } } Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawTabbedPane.java URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawTabbedPane.java?rev=824265&r1=824264&r2=824265&view=diff ============================================================================== --- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawTabbedPane.java (original) +++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawTabbedPane.java Mon Oct 12 08:52:26 2009 @@ -21,15 +21,11 @@ */ package org.apache.log4j.chainsaw; -import org.apache.log4j.chainsaw.prefs.SettingsManager; -import org.apache.log4j.chainsaw.prefs.SettingsListener; -import org.apache.log4j.chainsaw.prefs.LoadSettingsEvent; -import org.apache.log4j.chainsaw.prefs.SaveSettingsEvent; - import java.awt.Component; +import java.awt.EventQueue; import java.io.File; -import java.io.FileWriter; import java.io.FileReader; +import java.io.FileWriter; import javax.swing.Icon; import javax.swing.JComponent; @@ -38,6 +34,11 @@ import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.io.xml.DomDriver; +import org.apache.log4j.chainsaw.prefs.LoadSettingsEvent; +import org.apache.log4j.chainsaw.prefs.SaveSettingsEvent; +import org.apache.log4j.chainsaw.prefs.SettingsListener; +import org.apache.log4j.chainsaw.prefs.SettingsManager; + /** * The only reason this class is needed is because @@ -97,6 +98,13 @@ super.insertTab(name, icon, component, null, getTabCount()); super.fireStateChanged(); + if (!"chainsaw-log".equals(name)) { + EventQueue.invokeLater(new Runnable() { + public void run() { + setSelectedTab(getTabCount() - 1); + } + }); + } } public void setSelectedTab(int index) { 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=824265&r1=824264&r2=824265&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 Oct 12 08:52:26 2009 @@ -235,7 +235,6 @@ private final int dividerSize; static final String TABLE_COLUMN_ORDER = "table.columns.order"; static final String TABLE_COLUMN_WIDTHS = "table.columns.widths"; - static final String COLUMNS_EXTENSION = ".columns"; static final String COLORS_EXTENSION = ".colors"; private static final int LOG_PANEL_SERIALIZATION_VERSION_NUMBER = 1; private int previousLastIndex = -1; 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=824265&r1=824264&r2=824265&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 Oct 12 08:52:26 2009 @@ -47,6 +47,7 @@ public static final Collection DATE_FORMATS; private static final Logger logger = LogManager.getLogger(LogPanelPreferenceModel.class); + private static final long serialVersionUID = 7526472295622776147L; static { Collection list = new ArrayList(); From generaldustinhughes@example.org Tue Oct 13 05:25:03 2009 Return-Path: <generaldustinhughes@example.org> Delivered-To: dustinhughes@example.org Received: (qmail 36843 invoked from network); 13 Oct 2009 05:25:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 13 Oct 2009 05:25:03 -0000 Received: (qmail 94400 invoked by uid 500); 13 Oct 2009 05:25:02 -0000 Delivered-To: dustinhughes@example.org Received: (qmail 94308 invoked by uid 500); 13 Oct 2009 05:25:02 -0000 Mailing-List: contact dustinhughes@example.org; run by ezmlm Precedence: bulk list-help: <mailto:dustinhughes@example.org> list-unsubscribe: <mailto:dustinhughes@example.org> List-Post: <mailto:dustinhughes@example.org> Reply-To: "Logging General" <dustinhughes@example.org> List-Id: <general.logging.apache.org> Delivered-To: mailing list dustinhughes@example.org Received: (qmail 94299 invoked by uid 99); 13 Oct 2009 05:25:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Oct 2009 05:25:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Oct 2009 05:24:58 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 4704023888D3; Tue, 13 Oct 2009 05:24:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r824592 - in /logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw: receivers/PluginPropertyEditorPanel.java receivers/ReceiverTreeCellRenderer.java receivers/ReceiversPanel.java vfs/VFSLogFilePatternReceiver.java Date: Tue, 13 Oct 2009 05:24:37 -0000 To: dustinhughes@example.org From: dustinhughes@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <dustinhughes@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sdeboy Date: Tue Oct 13 05:24:36 2009 New Revision: 824592 URL: http://svn.apache.org/viewvc?rev=824592&view=rev Log: Chainsaw UI updates - increase receiver panel tree and table row heights, add scroll pane around receivers table - require non-blank name field when creating or editing receiver configuration - modify receivers jtree cell cell rendering logic so preferred size is wider VFSLogFilePatternReceiver - if null fileURL is provided, log instead of throw NPE Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/receivers/PluginPropertyEditorPanel.java logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/receivers/ReceiverTreeCellRenderer.java logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/receivers/ReceiversPanel.java logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/receivers/PluginPropertyEditorPanel.java URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/receivers/PluginPropertyEditorPanel.java?rev=824592&r1=824591&r2=824592&view=diff ============================================================================== --- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/receivers/PluginPropertyEditorPanel.java (original) +++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/receivers/PluginPropertyEditorPanel.java Tue Oct 13 05:24:36 2009 @@ -84,7 +84,7 @@ * */ private void initComponents() { - setPreferredSize(new Dimension(160, 120)); + propertyTable.setRowHeight(19); setLayout(new BorderLayout()); scrollPane.setViewportView(propertyTable); @@ -348,6 +348,10 @@ if (columnIndex == 1) { + if (descriptors[rowIndex].getName().toLowerCase().equals("name") && aValue == null || aValue.toString().trim().equals("")) { + logger.error("Name required"); + return; + } aValue = translateValueIfNeeded(rowIndex, aValue); logger.debug( "setValueAt, " + rowIndex + ", " + columnIndex + @@ -370,7 +374,7 @@ } /** - * @param columnIndex + * @param row * @param value * @return */ Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/receivers/ReceiverTreeCellRenderer.java URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/receivers/ReceiverTreeCellRenderer.java?rev=824592&r1=824591&r2=824592&view=diff ============================================================================== --- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/receivers/ReceiverTreeCellRenderer.java (original) +++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/receivers/ReceiverTreeCellRenderer.java Tue Oct 13 05:24:36 2009 @@ -17,14 +17,9 @@ package org.apache.log4j.chainsaw.receivers; -import java.awt.BorderLayout; -import java.awt.Component; +import java.awt.*; -import javax.swing.Icon; -import javax.swing.ImageIcon; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JTree; +import javax.swing.*; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeCellRenderer; @@ -48,10 +43,13 @@ public ReceiverTreeCellRenderer() { super(); + BoxLayout layout = new BoxLayout(panel, BoxLayout.X_AXIS); + panel.setLayout(layout); panel.setOpaque(false); - panel.setLayout(new BorderLayout()); - panel.add(this, BorderLayout.CENTER); - panel.add(levelLabel, BorderLayout.EAST); + panel.add(levelLabel); + //set preferredsize to something wide + setPreferredSize(new Dimension(200, 19)); + panel.add(this); } public Component getTreeCellRendererComponent( Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/receivers/ReceiversPanel.java URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/receivers/ReceiversPanel.java?rev=824592&r1=824591&r2=824592&view=diff ============================================================================== --- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/receivers/ReceiversPanel.java (original) +++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/receivers/ReceiversPanel.java Tue Oct 13 05:24:36 2009 @@ -17,9 +17,7 @@ package org.apache.log4j.chainsaw.receivers; -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Container; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; @@ -375,6 +373,7 @@ receiversTree.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); receiversTree.setCellRenderer(new ReceiverTreeCellRenderer()); + receiversTree.setRowHeight(19); buttonPanel = new ReceiverToolbar(); receiversTree.addTreeSelectionListener(buttonPanel); @@ -763,11 +762,15 @@ panel.getOkPanel().getOkButton().addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e2) { - dialog.dispose(); Plugin plugin = panel.getPlugin(); - pluginRegistry.addPlugin(plugin); - plugin.activateOptions(); - MessageCenter.getInstance().addMessage("Plugin '" + plugin.getName() + "' started"); + if (plugin.getName() != null && !plugin.getName().trim().equals("")) { + dialog.dispose(); + pluginRegistry.addPlugin(plugin); + plugin.activateOptions(); + MessageCenter.getInstance().addMessage("Plugin '" + plugin.getName() + "' started"); + } else { + MessageCenter.getInstance().getLogger().error("Name required to create receiver"); + } } }); dialog.setVisible(true); Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java?rev=824592&r1=824591&r2=824592&view=diff ============================================================================== --- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java (original) +++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java Tue Oct 13 05:24:36 2009 @@ -303,18 +303,22 @@ }}).start(); } else { String oldURL = getFileURL(); - int index = oldURL.indexOf("://"); - String lastPart = oldURL.substring(index + "://".length()); - int passEndIndex = lastPart.indexOf("@"); - if (passEndIndex > -1) { //we have a username/password - int passBeginIndex = lastPart.indexOf(":"); -// String userName = lastPart.substring(0, passBeginIndex); - password = lastPart.substring(passBeginIndex + 1, passEndIndex); - setHost(oldURL.substring(0, index + "://".length())); - setPath(lastPart.substring(passEndIndex + 1)); - } - vfsReader = new VFSReader(); - new Thread(vfsReader).start(); + if (oldURL != null) { + int index = oldURL.indexOf("://"); + String lastPart = oldURL.substring(index + "://".length()); + int passEndIndex = lastPart.indexOf("@"); + if (passEndIndex > -1) { //we have a username/password + int passBeginIndex = lastPart.indexOf(":"); + // String userName = lastPart.substring(0, passBeginIndex); + password = lastPart.substring(passBeginIndex + 1, passEndIndex); + setHost(oldURL.substring(0, index + "://".length())); + setPath(lastPart.substring(passEndIndex + 1)); + } + vfsReader = new VFSReader(); + new Thread(vfsReader).start(); + } else { + getLogger().info("null URL - unable to parse file"); + } } } From generaldustinhughes@example.org Tue Oct 13 05:36:18 2009 Return-Path: <generaldustinhughes@example.org> Delivered-To: dustinhughes@example.org Received: (qmail 38562 invoked from network); 13 Oct 2009 05:36:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 13 Oct 2009 05:36:18 -0000 Received: (qmail 3202 invoked by uid 500); 13 Oct 2009 05:36:17 -0000 Delivered-To: dustinhughes@example.org Received: (qmail 3109 invoked by uid 500); 13 Oct 2009 05:36:17 -0000 Mailing-List: contact dustinhughes@example.org; run by ezmlm Precedence: bulk list-help: <mailto:dustinhughes@example.org> list-unsubscribe: <mailto:dustinhughes@example.org> List-Post: <mailto:dustinhughes@example.org> Reply-To: "Logging General" <dustinhughes@example.org> List-Id: <general.logging.apache.org> Delivered-To: mailing list dustinhughes@example.org Received: (qmail 3098 invoked by uid 99); 13 Oct 2009 05:36:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Oct 2009 05:36:17 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Oct 2009 05:36:14 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 77AD423888D3; Tue, 13 Oct 2009 05:35:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r824593 - /logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/FileLoadAction.java Date: Tue, 13 Oct 2009 05:35:53 -0000 To: dustinhughes@example.org From: dustinhughes@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <dustinhughes@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sdeboy Date: Tue Oct 13 05:35:53 2009 New Revision: 824593 URL: http://svn.apache.org/viewvc?rev=824593&view=rev Log: Fix 35180: Multiple lines "XML files (*.xml)" in drop down list "Files of type" Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/FileLoadAction.java Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/FileLoadAction.java URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/FileLoadAction.java?rev=824593&r1=824592&r2=824593&view=diff ============================================================================== --- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/FileLoadAction.java (original) +++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/FileLoadAction.java Tue Oct 13 05:35:53 2009 @@ -84,22 +84,22 @@ if (!remoteURL) { if (chooser == null) { chooser = new JFileChooser(); - } - chooser.setDialogTitle("Load Events from XML file..."); + chooser.setDialogTitle("Load Events from XML file..."); - chooser.setAcceptAllFileFilterUsed(true); + chooser.setAcceptAllFileFilterUsed(true); - chooser.setFileFilter(new FileFilter() { - public boolean accept(File f) { - return (f.getName().toLowerCase().endsWith(".xml") || f - .isDirectory()); - } + chooser.setFileFilter(new FileFilter() { + public boolean accept(File f) { + return (f.getName().toLowerCase().endsWith(".xml") || f + .isDirectory()); + } - public String getDescription() { - return "XML files (*.xml)"; - } - }); + public String getDescription() { + return "XML files (*.xml)"; + } + }); + } int i = chooser.showOpenDialog(parent); if (i != JFileChooser.APPROVE_OPTION) { From generaldustinhughes@example.org Tue Oct 13 06:24:25 2009 Return-Path: <generaldustinhughes@example.org> Delivered-To: dustinhughes@example.org Received: (qmail 51069 invoked from network); 13 Oct 2009 06:24:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 13 Oct 2009 06:24:24 -0000 Received: (qmail 39524 invoked by uid 500); 13 Oct 2009 06:24:24 -0000 Delivered-To: dustinhughes@example.org Received: (qmail 39433 invoked by uid 500); 13 Oct 2009 06:24:24 -0000 Mailing-List: contact dustinhughes@example.org; run by ezmlm Precedence: bulk list-help: <mailto:dustinhughes@example.org> list-unsubscribe: <mailto:dustinhughes@example.org> List-Post: <mailto:dustinhughes@example.org> Reply-To: "Logging General" <dustinhughes@example.org> List-Id: <general.logging.apache.org> Delivered-To: mailing list dustinhughes@example.org Received: (qmail 39424 invoked by uid 99); 13 Oct 2009 06:24:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Oct 2009 06:24:24 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Oct 2009 06:24:21 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E9C0C23888D0; Tue, 13 Oct 2009 06:23:59 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r824604 - /logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameTreePanel.java Date: Tue, 13 Oct 2009 06:23:59 -0000 To: dustinhughes@example.org From: dustinhughes@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <dustinhughes@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sdeboy Date: Tue Oct 13 06:23:59 2009 New Revision: 824604 URL: http://svn.apache.org/viewvc?rev=824604&view=rev Log: Fix 47210 - - ignore not ignoring, yet "focus on" works 'Ignore' was only working for specific packages, not subpackages, and only working if a logger was selected in the list Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameTreePanel.java 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=824604&r1=824603&r2=824604&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 Tue Oct 13 06:23:59 2009 @@ -159,16 +159,16 @@ public boolean evaluate(LoggingEvent e) { String currentlySelectedLoggerName = getCurrentlySelectedLoggerName(); + boolean hidden = e.getLoggerName() != null && isHidden(e.getLoggerName()); if (currentlySelectedLoggerName == null) { - //if there is no selected logger, all events should pass - return true; + //if there is no selected logger, pass if not hidden + return !hidden; } - boolean isHidden = getHiddenSet().contains(e.getLoggerName()); - boolean result = (e.getLoggerName() != null) && (!isHidden); + boolean result = (e.getLoggerName() != null) && !hidden; if (result && isFocusOnSelected()) { - result = result && (e.getLoggerName() != null && (e.getLoggerName().startsWith(currentlySelectedLoggerName+".") || e.getLoggerName().endsWith(currentlySelectedLoggerName))) ; + result = (e.getLoggerName() != null && (e.getLoggerName().startsWith(currentlySelectedLoggerName+".") || e.getLoggerName().endsWith(currentlySelectedLoggerName))); } return result; @@ -180,10 +180,10 @@ { public boolean evaluate(LoggingEvent e) { - boolean isHidden = getHiddenSet().contains(e.getLoggerName()); + boolean hidden = e.getLoggerName() != null && isHidden(e.getLoggerName()); String currentlySelectedLoggerName = getCurrentlySelectedLoggerName(); - if (!isFocusOnSelected() && !isHidden && currentlySelectedLoggerName != null && !"".equals(currentlySelectedLoggerName)) + if (!isFocusOnSelected() && !hidden && currentlySelectedLoggerName != null && !"".equals(currentlySelectedLoggerName)) { return (e.getLoggerName().startsWith(currentlySelectedLoggerName+".") || e.getLoggerName().endsWith(currentlySelectedLoggerName)) ; } @@ -401,7 +401,7 @@ /** * Ensures the Focus is set to a specific logger name - * @param logger + * @param */ public void setFocusOn(String newLogger) { @@ -424,6 +424,18 @@ } } + private boolean isHidden(String loggerName) { + for (Iterator iter = hiddenSet.iterator();iter.hasNext();) { + String hiddenLoggerEntry = iter.next().toString(); + if (loggerName.startsWith(hiddenLoggerEntry + ".") || loggerName.endsWith(hiddenLoggerEntry)) { + return true; + } + } + return false; + } + + + /** * DOCUMENT ME! * @@ -467,15 +479,6 @@ } /** - * Returns an unmodifiable set of those Loggers marked as hidden. - * @return - */ - Set getHiddenSet() - { - return Collections.unmodifiableSet(hiddenSet); - } - - /** * Returns the full * @param path DOCUMENT ME! * @return @@ -1159,7 +1162,7 @@ private void updateHiddenSetModels() { DefaultListModel model = (DefaultListModel) ignoreList.getModel(); model.clear(); - List sortedIgnoreList = new ArrayList(getHiddenSet()); + List sortedIgnoreList = new ArrayList(hiddenSet); Collections.sort(sortedIgnoreList); for (Iterator iter = sortedIgnoreList.iterator(); iter.hasNext();) @@ -1181,6 +1184,10 @@ hideAction.setEnabled(!isFocusOnSelected()); } + public Collection getHiddenSet() { + return Collections.unmodifiableSet(hiddenSet); + } + //~ Inner Classes =========================================================== /** From generaldustinhughes@example.org Thu Oct 15 03:56:10 2009 Return-Path: <generaldustinhughes@example.org> Delivered-To: dustinhughes@example.org Received: (qmail 63801 invoked from network); 15 Oct 2009 03:56:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 15 Oct 2009 03:56:10 -0000 Received: (qmail 46216 invoked by uid 500); 15 Oct 2009 03:56:09 -0000 Delivered-To: dustinhughes@example.org Received: (qmail 46057 invoked by uid 500); 15 Oct 2009 03:56:09 -0000 Mailing-List: contact dustinhughes@example.org; run by ezmlm Precedence: bulk list-help: <mailto:dustinhughes@example.org> list-unsubscribe: <mailto:dustinhughes@example.org> List-Post: <mailto:dustinhughes@example.org> Reply-To: "Logging General" <dustinhughes@example.org> List-Id: <general.logging.apache.org> Delivered-To: mailing list dustinhughes@example.org Received: (qmail 46048 invoked by uid 99); 15 Oct 2009 03:56:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Oct 2009 03:56:08 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Oct 2009 03:56:06 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E22CB238888F; Thu, 15 Oct 2009 03:55:45 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r825384 - in /logging/chainsaw/trunk/src/main: java/org/apache/log4j/chainsaw/ resources/org/apache/log4j/chainsaw/prefs/ Date: Thu, 15 Oct 2009 03:55:45 -0000 To: dustinhughes@example.org From: dustinhughes@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <dustinhughes@example.org> Author: sdeboy Date: Thu Oct 15 03:55:45 2009 New Revision: 825384 URL: http://svn.apache.org/viewvc?rev=825384&view=rev Log: Make sure all default columns are added to the 'columns' of the preferencemodel (so defaults can be re-enabled if previously disabled) Modified: 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/LogPanelPreferencePanel.java logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/prefs/default.properties 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=825384&r1=825383&r2=825384&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 Thu Oct 15 03:55:45 2009 @@ -1547,7 +1547,19 @@ in = stream.createObjectInputStream(r); LogPanelPreferenceModel storedPrefs = (LogPanelPreferenceModel)in.readObject(); + String columnOrder = event.getSetting(TABLE_COLUMN_ORDER); preferenceModel.apply(storedPrefs); + + //update prefModel columns to include defaults + int index = 0; + StringTokenizer tok = new StringTokenizer(columnOrder, ","); + while (tok.hasMoreElements()) { + String element = tok.nextElement().toString().trim(); + TableColumn column = new TableColumn(index++); + column.setHeaderValue(element); + preferenceModel.addColumn(column); + } + TableColumnModel columnModel = table.getColumnModel(); //remove previous columns while (columnModel.getColumnCount() > 0) { 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=825384&r1=825383&r2=825384&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 Thu Oct 15 03:55:45 2009 @@ -134,7 +134,7 @@ if (findColumnByHeader(allColumns, column.getHeaderValue().toString()) != null) { return false; } - + Object oldValue = allColumns; allColumns = new ArrayList(allColumns); allColumns.add(column); @@ -276,11 +276,11 @@ /** * Returns true if the named column should be made visible otherwise * false. - * @param columnName + * @param column * @return column visible flag */ public boolean isColumnVisible(TableColumn column) { - return (visibleColumns.contains(column)); + return (findColumnByHeader(visibleColumns, column.getHeaderValue().toString()) != null); } private void setVisibleColumns(List visibleColumns) { @@ -292,20 +292,19 @@ public void setColumnVisible(String columnName, boolean isVisible) { boolean wasVisible = findColumnByHeader(visibleColumns, columnName) != null; - boolean newVisible = isVisible; - //because we're a list and not a set, ensure we keep at most + //because we're a list and not a set, ensure we keep at most //one entry for a tablecolumn Object col = findColumnByHeader(allColumns, columnName); - if (newVisible && !wasVisible) { + if (isVisible && !wasVisible) { visibleColumns.add(col); visibleColumnOrder.add(col); - propertySupport.firePropertyChange("visibleColumns", new Boolean(newVisible), new Boolean(wasVisible)); + propertySupport.firePropertyChange("visibleColumns", new Boolean(isVisible), new Boolean(wasVisible)); } - if (!newVisible && wasVisible) { + if (!isVisible && wasVisible) { visibleColumns.remove(col); visibleColumnOrder.remove(col); - propertySupport.firePropertyChange("visibleColumns", new Boolean(newVisible), new Boolean(wasVisible)); + propertySupport.firePropertyChange("visibleColumns", new Boolean(isVisible), new Boolean(wasVisible)); } } Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanelPreferencePanel.java URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanelPreferencePanel.java?rev=825384&r1=825383&r2=825384&view=diff ============================================================================== --- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanelPreferencePanel.java (original) +++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanelPreferencePanel.java Thu Oct 15 03:55:45 2009 @@ -25,6 +25,7 @@ import java.awt.event.MouseEvent; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; +import java.util.Enumeration; import java.util.Iterator; import java.util.List; @@ -174,7 +175,18 @@ Iterator iter = preferenceModel.getColumns().iterator(); iter.hasNext();) { - columnListModel.addElement(iter.next()); + TableColumn col = (TableColumn)iter.next(); + Enumeration enumeration = columnListModel.elements(); + boolean found = false; + while (enumeration.hasMoreElements()) { + TableColumn thisCol = (TableColumn) enumeration.nextElement(); + if (thisCol.getHeaderValue().equals(col.getHeaderValue())) { + found = true; + } + } + if (!found) { + columnListModel.addElement(col); + } } columnList.setModel(columnListModel); @@ -643,7 +655,15 @@ iter.hasNext();) { TableColumn col = (TableColumn) iter.next(); - if (!columnListModel.contains(col)) { + Enumeration enumeration = columnListModel.elements(); + boolean found = false; + while (enumeration.hasMoreElements()) { + TableColumn thisCol = (TableColumn) enumeration.nextElement(); + if (thisCol.getHeaderValue().equals(col.getHeaderValue())) { + found = true; + } + } + if (!found) { columnListModel.addElement(col); columnListModel.fireContentsChanged(); } @@ -658,7 +678,6 @@ columnListModel.fireContentsChanged(); } }); - } } } Modified: logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/prefs/default.properties URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/prefs/default.properties?rev=825384&r1=825383&r2=825384&view=diff ============================================================================== --- logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/prefs/default.properties (original) +++ logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/prefs/default.properties Thu Oct 15 03:55:45 2009 @@ -9,7 +9,8 @@ main.window.width=640 main.window.height=480 -table.columns.order=ID,Timestamp,Level,Logger,Message,Throwable,Thread,NDC,Class,Method,File,Line +#entries need to have 1st char uppercase, remaining lowercase +table.columns.order=Id,Timestamp,Level,Logger,Message,Throwable,Thread,Ndc,Class,Method,File,Line table.columns.widths=50,150,50,100,300,100,150,150,300,150,100,100 SavedConfigs.Size=0 From generaldustinhughes@example.org Tue Oct 20 06:43:52 2009 Return-Path: <generaldustinhughes@example.org> Delivered-To: dustinhughes@example.org Received: (qmail 24092 invoked from network); 20 Oct 2009 06:43:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 20 Oct 2009 06:43:52 -0000 Received: (qmail 53492 invoked by uid 500); 20 Oct 2009 06:43:51 -0000 Delivered-To: dustinhughes@example.org Received: (qmail 53353 invoked by uid 500); 20 Oct 2009 06:43:51 -0000 Mailing-List: contact dustinhughes@example.org; run by ezmlm Precedence: bulk list-help: <mailto:dustinhughes@example.org> list-unsubscribe: <mailto:dustinhughes@example.org> List-Post: <mailto:dustinhughes@example.org> Reply-To: "Logging General" <dustinhughes@example.org> List-Id: <general.logging.apache.org> Delivered-To: mailing list dustinhughes@example.org Received: (qmail 53344 invoked by uid 99); 20 Oct 2009 06:43:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Oct 2009 06:43:51 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Oct 2009 06:43:48 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1E37423888D4; Tue, 20 Oct 2009 06:43:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r826975 - in /logging/chainsaw/trunk/src/main: java/org/apache/log4j/chainsaw/ChainsawCyclicBufferTableModel.java java/org/apache/log4j/chainsaw/LogPanel.java resources/org/apache/log4j/chainsaw/prefs/default.properties Date: Tue, 20 Oct 2009 06:43:27 -0000 To: dustinhughes@example.org From: dustinhughes@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <dustinhughes@example.org> Author: sdeboy Date: Tue Oct 20 06:43:27 2009 New Revision: 826975 URL: http://svn.apache.org/viewvc?rev=826975&view=rev Log: Fix 'set refine focus' and 'find next' - mixed-case col names weren't matching 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/resources/org/apache/log4j/chainsaw/prefs/default.properties 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=826975&r1=826974&r2=826975&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 Tue Oct 20 06:43:27 2009 @@ -338,9 +338,7 @@ } public String getColumnName(int column) { - //columnNames all upper, make 1st char upper & rest lower - String col = (String) columnNames.get(column); - return col.substring(0, 1).toUpperCase() + col.substring(1).toLowerCase(); + return (String) columnNames.get(column); } public LoggingEvent getRow(int row) { @@ -506,10 +504,9 @@ if (!columnNames.contains(key) && !(Constants.LOG4J_ID_KEY.equalsIgnoreCase(key))) { columnNames.add(key); logger.debug("Adding col '" + key + "', columnNames=" + columnNames); - String mixedCaseKey = key.substring(0, 1).toUpperCase() + key.substring(1).toLowerCase(); fireNewKeyColumnAdded( new NewKeyEvent( - this, columnNames.indexOf(key), mixedCaseKey, e.getProperty(key))); + this, columnNames.indexOf(key), key, e.getProperty(key))); } } } 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=826975&r1=826974&r2=826975&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 Tue Oct 20 06:43:27 2009 @@ -1234,7 +1234,7 @@ String operator = "=="; int column = table.columnAtPoint(currentPoint); int row = table.rowAtPoint(currentPoint); - String colName = table.getColumnName(column); + String colName = table.getColumnName(column).toUpperCase(); String value = ""; if (colName.equalsIgnoreCase(ChainsawConstants.TIMESTAMP_COL_NAME)) { @@ -1270,7 +1270,7 @@ String operator = "=="; int column = table.columnAtPoint(currentPoint); int row = table.rowAtPoint(currentPoint); - String colName = table.getColumnName(column); + String colName = table.getColumnName(column).toUpperCase(); String value = ""; if (colName.equalsIgnoreCase(ChainsawConstants.TIMESTAMP_COL_NAME)) { @@ -1345,7 +1345,7 @@ String operator = "~="; int column = table.columnAtPoint(currentPoint); int row = table.rowAtPoint(currentPoint); - String colName = table.getColumnName(column); + String colName = table.getColumnName(column).toUpperCase(); String value = ""; if (colName.equalsIgnoreCase(ChainsawConstants.TIMESTAMP_COL_NAME)) { @@ -1554,7 +1554,7 @@ int index = 0; StringTokenizer tok = new StringTokenizer(columnOrder, ","); while (tok.hasMoreElements()) { - String element = tok.nextElement().toString().trim(); + String element = tok.nextElement().toString().trim().toUpperCase(); TableColumn column = new TableColumn(index++); column.setHeaderValue(element); preferenceModel.addColumn(column); @@ -2336,7 +2336,7 @@ Map columnNameMap = new HashMap(); for (int i = 0; i < columnModel.getColumnCount(); i++) { - columnNameMap.put(table.getColumnName(i), columnModel.getColumn(i)); + columnNameMap.put(table.getColumnName(i).toUpperCase(), columnModel.getColumn(i)); } int index = 0; @@ -2349,7 +2349,7 @@ (may be a subset of possible columns) **/ while (tok.hasMoreElements()) { - String element = (String) tok.nextElement(); + String element = tok.nextElement().toString().trim().toUpperCase(); TableColumn column = (TableColumn) columnNameMap.get(element); if (column != null) { Modified: logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/prefs/default.properties URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/prefs/default.properties?rev=826975&r1=826974&r2=826975&view=diff ============================================================================== --- logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/prefs/default.properties (original) +++ logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/prefs/default.properties Tue Oct 20 06:43:27 2009 @@ -9,8 +9,7 @@ main.window.width=640 main.window.height=480 -#entries need to have 1st char uppercase, remaining lowercase -table.columns.order=Id,Timestamp,Level,Logger,Message,Throwable,Thread,Ndc,Class,Method,File,Line +table.columns.order=ID,TIMESTAMP,LEVEL,LOGGER,MESSAGE,THROWABLE,THREAD,NDC,CLASS,METHOD,FILE,LINE table.columns.widths=50,150,50,100,300,100,150,150,300,150,100,100 SavedConfigs.Size=0 From generaldustinhughes@example.org Sun Oct 25 07:42:49 2009 Return-Path: <generaldustinhughes@example.org> Delivered-To: dustinhughes@example.org Received: (qmail 55559 invoked from network); 25 Oct 2009 07:42:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 25 Oct 2009 07:42:48 -0000 Received: (qmail 16059 invoked by uid 500); 25 Oct 2009 07:42:48 -0000 Delivered-To: dustinhughes@example.org Received: (qmail 15945 invoked by uid 500); 25 Oct 2009 07:42:48 -0000 Mailing-List: contact dustinhughes@example.org; run by ezmlm Precedence: bulk list-help: <mailto:dustinhughes@example.org> list-unsubscribe: <mailto:dustinhughes@example.org> List-Post: <mailto:dustinhughes@example.org> Reply-To: "Logging General" <dustinhughes@example.org> List-Id: <general.logging.apache.org> Delivered-To: mailing list dustinhughes@example.org Received: (qmail 15936 invoked by uid 99); 25 Oct 2009 07:42:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Oct 2009 07:42:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Oct 2009 07:42:44 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 936C523888CF; Sun, 25 Oct 2009 07:42:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r829505 - in /logging/chainsaw/trunk/src/main: java/org/apache/log4j/chainsaw/ java/org/apache/log4j/chainsaw/icons/ resources/org/apache/log4j/chainsaw/ Date: Sun, 25 Oct 2009 07:42:22 -0000 To: dustinhughes@example.org From: dustinhughes@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <dustinhughes@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sdeboy Date: Sun Oct 25 07:42:21 2009 New Revision: 829505 URL: http://svn.apache.org/viewvc?rev=829505&view=rev Log: Add new 'marker' feature Marker is displayed as an icon that appears in the first displayed column (using 'about' icon currently) Ctrl-F2 or double-click: toggle a marker on or off F2: search for next marker Shift-F2: search for previous marker Ctrl-Shift-F2: clear all markers To facilitate search, rendering & toggle of markers, adding a marker temporarily adds a new property to events that have the marker set called 'log4j.marker' (value 'true')'. Also added a new method to LoggingEvent: public Object removeProperty(String propName) to facilitate removal of this temporary property when the marker is un-set for a loggingevent Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawConstants.java logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawCyclicBufferTableModel.java logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawToolBarAndMenus.java logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/EventContainer.java logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/TableColorizingRenderer.java logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/icons/ChainsawIcons.java logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/WelcomePanel.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=829505&r1=829504&r2=829505&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 Sun Oct 25 07:42:21 2009 @@ -79,7 +79,9 @@ static final String LEVEL_DISPLAY = "level.display"; static final String LEVEL_DISPLAY_ICONS = "icons"; - static final String LEVEL_DISPLAY_TEXT = "text"; + static final String LEVEL_DISPLAY_TEXT = "text"; + + static final String MARKER_PROPERTY_NAME = "log4j.marker"; static final String DATETIME_FORMAT = "EEE MMM dd HH:mm:ss z yyyy"; 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=829505&r1=829504&r2=829505&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 Sun Oct 25 07:42:21 2009 @@ -333,7 +333,21 @@ } } - public int getColumnCount() { + public void removePropertyFromEvents(String propName) { + for (Iterator iter = unfilteredList.iterator();iter.hasNext();) { + LoggingEvent event = (LoggingEvent)iter.next(); + event.removeProperty(propName); + } + for (int i=0;i<filteredList.size();i++) { + LoggingEvent event = (LoggingEvent)filteredList.get(i); + Object result = event.removeProperty(propName); + if (result != null) { + fireRowUpdated(i); + } + } + } + + public int getColumnCount() { return columnNames.size(); } @@ -549,7 +563,11 @@ }}); } - /** + public void fireRowUpdated(int row) { + fireTableRowsUpdated(row, row); + } + + /** * @param e */ private void fireNewKeyColumnAdded(NewKeyEvent e) { Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawToolBarAndMenus.java URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawToolBarAndMenus.java?rev=829505&r1=829504&r2=829505&view=diff ============================================================================== --- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawToolBarAndMenus.java (original) +++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawToolBarAndMenus.java Sun Oct 25 07:42:21 2009 @@ -75,6 +75,10 @@ private final Action closeAction; private final Action findNextAction; private final Action findPreviousAction; + private final Action findNextMarkerAction; + private final Action findPreviousMarkerAction; + private final Action toggleMarkerAction; + private final Action clearAllMarkersAction; private final Action pauseAction; private final Action showPreferencesAction; private final Action showColorPanelAction; @@ -114,7 +118,7 @@ private final JMenu activeTabMenu = new JMenu("Current tab"); private final JPanel findPanel; - ChainsawToolBarAndMenus(final LogUI logui) { + ChainsawToolBarAndMenus(final LogUI logui) { this.logui = logui; toolbar = new JToolBar(SwingConstants.HORIZONTAL); menuBar = new JMenuBar(); @@ -124,6 +128,10 @@ findField = new JTextField(); findNextAction = getFindNextAction(); findPreviousAction = getFindPreviousAction(); + findNextMarkerAction = createFindNextMarkerAction(); + findPreviousMarkerAction = createFindPreviousMarkerAction(); + toggleMarkerAction = createToggleMarkerAction(); + clearAllMarkersAction = createClearAllMarkersAction(); customExpressionPanelAction = createCustomExpressionPanelAction(); showPreferencesAction = createShowPreferencesAction(); showColorPanelAction = createShowColorPanelAction(); @@ -155,7 +163,8 @@ logPanelSpecificActions = new Action[] { - pauseAction, findNextAction, findPreviousAction, clearAction, + pauseAction, findNextAction, findPreviousAction, findNextMarkerAction, findPreviousMarkerAction, + toggleMarkerAction, clearAllMarkersAction, clearAction, fileMenu.getFileSaveAction(), toggleDetailPaneAction, showPreferencesAction, showColorPanelAction, undockAction, toggleLogTreeAction, toggleScrollToBottomAction, changeModelAction, @@ -250,6 +259,78 @@ return action; } + private Action createFindNextMarkerAction() { + Action action = + new AbstractAction("Find next marker") { + public void actionPerformed(ActionEvent e) { + if (logui.getCurrentLogPanel() != null) { + logui.getCurrentLogPanel().findNextMarker(); + } + } + }; + + action.putValue(Action.SHORT_DESCRIPTION, "Searches for the next marker from the current location"); + action.putValue("enabled", Boolean.TRUE); + action.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_N)); + action.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke("F2")); + + return action; + } + + private Action createFindPreviousMarkerAction() { + Action action = + new AbstractAction("Find previous marker") { + public void actionPerformed(ActionEvent e) { + if (logui.getCurrentLogPanel() != null) { + logui.getCurrentLogPanel().findPreviousMarker(); + } + } + }; + + action.putValue(Action.SHORT_DESCRIPTION, "Searches for the previous marker from the current location"); + action.putValue("enabled", Boolean.TRUE); + action.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_P)); + action.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_F2, InputEvent.SHIFT_MASK)); + + return action; + } + + private Action createToggleMarkerAction() { + Action action = + new AbstractAction("Toggle marker") { + public void actionPerformed(ActionEvent e) { + if (logui.getCurrentLogPanel() != null) { + logui.getCurrentLogPanel().toggleMarker(); + } + } + }; + + action.putValue(Action.SHORT_DESCRIPTION, "Toggle marker for selected row"); + action.putValue("enabled", Boolean.TRUE); + action.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_T)); + action.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_F2, InputEvent.CTRL_MASK)); + + return action; + } + + private Action createClearAllMarkersAction() { + Action action = + new AbstractAction("Clear all markers") { + public void actionPerformed(ActionEvent e) { + if (logui.getCurrentLogPanel() != null) { + logui.getCurrentLogPanel().clearAllMarkers(); + } + } + }; + + action.putValue(Action.SHORT_DESCRIPTION, "Removes all markers"); + action.putValue("enabled", Boolean.TRUE); + action.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_R)); + action.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_F2, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK)); + + return action; + } + /** * DOCUMENT ME! */ @@ -412,6 +493,13 @@ activeTabMenu.addSeparator(); activeTabMenu.add(new CopyEventsToClipboardAction(logui)); activeTabMenu.add(new JMenuItem(clearAction)); + + activeTabMenu.addSeparator(); + activeTabMenu.add(new JMenuItem(toggleMarkerAction)); + activeTabMenu.add(new JMenuItem(findNextMarkerAction)); + activeTabMenu.add(new JMenuItem(findPreviousMarkerAction)); + activeTabMenu.add(new JMenuItem(clearAllMarkersAction)); + activeTabMenu.addSeparator(); activeTabMenu.add(toggleScrollToBottomMenuItem); activeTabMenu.add(menuItemUseRightMouse); Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/EventContainer.java URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/EventContainer.java?rev=829505&r1=829504&r2=829505&view=diff ============================================================================== --- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/EventContainer.java (original) +++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/EventContainer.java Sun Oct 25 07:42:21 2009 @@ -140,6 +140,11 @@ */ void fireTableEvent(int begin, int end, int count); + /** + * A row was updated + * @param row + */ + void fireRowUpdated(int row); /** * Allow a forced notification of the EventCountListeners * @@ -157,4 +162,10 @@ * @param e */ int getRowIndex(LoggingEvent e); + + /** + * Remove property from all events in container + * @param propName the property name to remove + */ + void removePropertyFromEvents(String propName); } 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=829505&r1=829504&r2=829505&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 Sun Oct 25 07:42:21 2009 @@ -230,6 +230,7 @@ private Point currentPoint; private boolean paused = false; private Rule findRule; + private Rule findMarkerRule; private final JPanel findPanel; private JTextField findField; private final int dividerSize; @@ -559,6 +560,13 @@ */ tableModel = new ChainsawCyclicBufferTableModel(cyclicBufferSize); table = new JSortTable(tableModel); + + //we've mapped f2, shift f2 and ctrl-f2 to marker-related actions, unmap them from the table + table.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke("F2"), "none"); + table.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_F2, InputEvent.SHIFT_MASK), "none"); + table.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_F2, InputEvent.CTRL_MASK), "none"); + table.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_F2, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK), "none"); + //add a listener to update the 'refine focus' tableModel.addNewKeyListener(new NewKeyListener() { public void newKeyAdded(NewKeyEvent e) { @@ -681,6 +689,7 @@ table.setAutoCreateColumnsFromModel(false); table.addMouseMotionListener(new TableColumnDetailMouseListener()); + table.addMouseListener(new TableMarkerListener()); table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); @@ -1022,7 +1031,8 @@ } }); - + findMarkerRule = ExpressionRule.getRule("prop." + ChainsawConstants.MARKER_PROPERTY_NAME + " exists"); + tableModel.addTableModelListener(new TableModelListener() { public void tableChanged(TableModelEvent e) { detailPaneUpdater.setSelectedRow(table.getSelectedRow()); @@ -1874,7 +1884,7 @@ "Enter expression - right click or ctrl-space for menu"); return false; } else { - //only turn off scroltobottom when finding something (find not empty) + //only turn off scrolltobottom when finding something (find not empty) preferenceModel.setScrollToBottom(false); try { findField.setToolTipText( @@ -2477,7 +2487,41 @@ filterModel.processNewLoggingEvent(event); } - /** + public void findNextMarker() { + final int nextRow = tableModel.find(findMarkerRule, table.getSelectedRow() + 1, true); + + if (nextRow > -1) { + table.scrollToRow(nextRow); + } + } + + public void findPreviousMarker() { + final int previousRow = tableModel.find(findMarkerRule, table.getSelectedRow() - 1, false); + + if (previousRow > -1) { + table.scrollToRow(previousRow); + } + } + + public void clearAllMarkers() { + tableModel.removePropertyFromEvents(ChainsawConstants.MARKER_PROPERTY_NAME); + } + + public void toggleMarker() { + int row = table.getSelectedRow(); + if (row != -1) { + LoggingEvent event = tableModel.getRow(row); + Object marker = event.getProperty(ChainsawConstants.MARKER_PROPERTY_NAME); + if (marker == null) { + event.setProperty(ChainsawConstants.MARKER_PROPERTY_NAME, "true"); + } else { + event.removeProperty(ChainsawConstants.MARKER_PROPERTY_NAME); + } + tableModel.fireRowUpdated(row); + } + } + + /** * This class receives notification when the Refine focus text field is * updated, where a backgrounh thread periodically wakes up and checks if * they have stopped typing yet. This ensures that the filtering of the @@ -2595,6 +2639,24 @@ } } + private final class TableMarkerListener extends MouseAdapter { + public void mouseClicked(MouseEvent evt) { + if (evt.getClickCount() == 2) { + int row = table.rowAtPoint(evt.getPoint()); + if (row != -1) { + LoggingEvent event = tableModel.getRow(row); + Object marker = event.getProperty(ChainsawConstants.MARKER_PROPERTY_NAME); + if (marker == null) { + event.setProperty(ChainsawConstants.MARKER_PROPERTY_NAME, "true"); + } else { + event.removeProperty(ChainsawConstants.MARKER_PROPERTY_NAME); + } + tableModel.fireRowUpdated(row); + } + } + } + } + /** * Update active tooltip */ Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/TableColorizingRenderer.java URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/TableColorizingRenderer.java?rev=829505&r1=829504&r2=829505&view=diff ============================================================================== --- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/TableColorizingRenderer.java (original) +++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/TableColorizingRenderer.java Sun Oct 25 07:42:21 2009 @@ -27,12 +27,14 @@ import javax.swing.BorderFactory; import javax.swing.Icon; +import javax.swing.ImageIcon; import javax.swing.JLabel; import javax.swing.JTable; import javax.swing.SwingConstants; import javax.swing.table.DefaultTableCellRenderer; import org.apache.log4j.chainsaw.color.Colorizer; +import org.apache.log4j.chainsaw.icons.ChainsawIcons; import org.apache.log4j.chainsaw.icons.LevelIconFactory; import org.apache.log4j.helpers.Constants; import org.apache.log4j.spi.LoggingEvent; @@ -60,6 +62,7 @@ private int loggerPrecision = 0; private boolean toolTipsVisible; private String dateFormatTZ; + private final Icon markerIcon = new ImageIcon(ChainsawIcons.MARKER); /** * Creates a new TableColorizingRenderer object. @@ -90,6 +93,9 @@ isSelected, hasFocus, row, col); int colIndex = table.getColumnModel().getColumn(col).getModelIndex() + 1; + EventContainer container = (EventContainer) table.getModel(); + LoggingEvent event = container.getRow(row); + switch (colIndex) { case ChainsawColumns.INDEX_ID_COL_NAME: idComponent.setText(value.toString()); @@ -150,6 +156,12 @@ default: break; } + //set the 'info' icon next to the zeroth column if marker is set + if (col == 0 && event.getProperty("log4j.marker") != null) { + c.setIcon(markerIcon); + } else { + c.setIcon(null); + } if (isSelected) { return c; @@ -159,8 +171,6 @@ Color foreground = null; if (colorizer != null) { - EventContainer container = (EventContainer) table.getModel(); - LoggingEvent event = container.getRow(row); if (event == null) { //ignore...probably changed displayed cols @@ -206,7 +216,7 @@ /** * Changes the Logger precision. - * @param precision + * @param loggerPrecisionText */ void setLoggerPrecision(String loggerPrecisionText) { try { Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/icons/ChainsawIcons.java URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/icons/ChainsawIcons.java?rev=829505&r1=829504&r2=829505&view=diff ============================================================================== --- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/icons/ChainsawIcons.java (original) +++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/icons/ChainsawIcons.java Sun Oct 25 07:42:21 2009 @@ -85,6 +85,9 @@ public static final URL HELP = ChainsawIcons.class.getClassLoader().getResource( BASE_ICON_PATH + "Help16.gif"); + public static final URL MARKER = + ChainsawIcons.class.getClassLoader().getResource( + BASE_ICON_PATH + "About16.gif"); public static final Icon ICON_UP = new ImageIcon(UP); public static final Icon ICON_DOWN = new ImageIcon(DOWN); public static final Icon ICON_HELP = new ImageIcon(HELP); Modified: logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/WelcomePanel.html URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/WelcomePanel.html?rev=829505&r1=829504&r2=829505&view=diff ============================================================================== --- logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/WelcomePanel.html (original) +++ logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/WelcomePanel.html Sun Oct 25 07:42:21 2009 @@ -84,6 +84,22 @@ <td width="50" align="center">-</td> <td colspan="1">Go to line</td> </tr> + <tr valign="top" bgcolor="#EEEEEE"> + <td nowrap class="HotKey">Ctrl-F2 (or double-click on a row)</td> + <td width="50" align="center">-</td> + <td colspan="1">Toggle marker</td> + <td nowrap class="HotKey">F2</td> + <td width="50" align="center">-</td> + <td colspan="1">Find next marker</td> + </tr> + <tr valign="top" bgcolor="#EEEEEE"> + <td nowrap class="HotKey">Shift-F2</td> + <td width="50" align="center">-</td> + <td colspan="1">Find previous marker</td> + <td nowrap class="HotKey">Ctrl-shift-F2</td> + <td width="50" align="center">-</td> + <td colspan="1">Clear all markers</td> + </tr> </table></P> <!--<p><a href="#TheTop">Back to top</a></p>--> <a name="Receivers"></a> From generaldustinhughes@example.org Sun Oct 25 08:10:49 2009 Return-Path: <generaldustinhughes@example.org> Delivered-To: dustinhughes@example.org Received: (qmail 57835 invoked from network); 25 Oct 2009 08:10:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 25 Oct 2009 08:10:48 -0000 Received: (qmail 19123 invoked by uid 500); 25 Oct 2009 08:10:48 -0000 Delivered-To: dustinhughes@example.org Received: (qmail 19022 invoked by uid 500); 25 Oct 2009 08:10:48 -0000 Mailing-List: contact dustinhughes@example.org; run by ezmlm Precedence: bulk list-help: <mailto:dustinhughes@example.org> list-unsubscribe: <mailto:dustinhughes@example.org> List-Post: <mailto:dustinhughes@example.org> Reply-To: "Logging General" <dustinhughes@example.org> List-Id: <general.logging.apache.org> Delivered-To: mailing list dustinhughes@example.org Received: (qmail 19013 invoked by uid 99); 25 Oct 2009 08:10:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Oct 2009 08:10:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Oct 2009 08:10:46 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 468F323888CF; Sun, 25 Oct 2009 08:10:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r829507 - /logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/FileSaveAction.java Date: Sun, 25 Oct 2009 08:10:25 -0000 To: dustinhughes@example.org From: dustinhughes@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <dustinhughes@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sdeboy Date: Sun Oct 25 08:10:24 2009 New Revision: 829507 URL: http://svn.apache.org/viewvc?rev=829507&view=rev Log: When saving events for a Chainsaw tab, save properties as well (including new 'marker' property if any events have the marker set) Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/FileSaveAction.java Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/FileSaveAction.java URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/FileSaveAction.java?rev=829507&r1=829506&r2=829507&view=diff ============================================================================== --- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/FileSaveAction.java (original) +++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/FileSaveAction.java Sun Oct 25 08:10:24 2009 @@ -88,6 +88,7 @@ File selectedFile = chooser.getSelectedFile(); XMLLayout layout = new XMLLayout(); + layout.setProperties(true); LoggingEvent event = null; PrintWriter out = null; From generaldustinhughes@example.org Sun Oct 25 22:11:25 2009 Return-Path: <generaldustinhughes@example.org> Delivered-To: dustinhughes@example.org Received: (qmail 14658 invoked from network); 25 Oct 2009 22:11:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 25 Oct 2009 22:11:24 -0000 Received: (qmail 21587 invoked by uid 500); 25 Oct 2009 22:11:24 -0000 Delivered-To: dustinhughes@example.org Received: (qmail 21455 invoked by uid 500); 25 Oct 2009 22:11:24 -0000 Mailing-List: contact dustinhughes@example.org; run by ezmlm Precedence: bulk list-help: <mailto:dustinhughes@example.org> list-unsubscribe: <mailto:dustinhughes@example.org> List-Post: <mailto:dustinhughes@example.org> Reply-To: "Logging General" <dustinhughes@example.org> List-Id: <general.logging.apache.org> Delivered-To: mailing list dustinhughes@example.org Received: (qmail 21446 invoked by uid 99); 25 Oct 2009 22:11:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Oct 2009 22:11:24 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Oct 2009 22:11:22 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3CFB423888CE; Sun, 25 Oct 2009 22:11:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r829666 - /logging/chainsaw/trunk/pom.xml Date: Sun, 25 Oct 2009 22:11:01 -0000 To: dustinhughes@example.org From: dustinhughes@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <dustinhughes@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sdeboy Date: Sun Oct 25 22:11:00 2009 New Revision: 829666 URL: http://svn.apache.org/viewvc?rev=829666&view=rev Log: Chainsaw now relies on log4j 1.2.16 (uses removeProperty) Modified: logging/chainsaw/trunk/pom.xml Modified: logging/chainsaw/trunk/pom.xml URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/pom.xml?rev=829666&r1=829665&r2=829666&view=diff ============================================================================== --- logging/chainsaw/trunk/pom.xml (original) +++ logging/chainsaw/trunk/pom.xml Sun Oct 25 22:11:00 2009 @@ -349,7 +349,7 @@ <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> - <version>1.2.15</version> + <version>1.2.16</version> </dependency> <dependency> <groupId>xstream</groupId> From generaldustinhughes@example.org Mon Oct 26 05:21:10 2009 Return-Path: <generaldustinhughes@example.org> Delivered-To: dustinhughes@example.org Received: (qmail 8755 invoked from network); 26 Oct 2009 05:21:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 26 Oct 2009 05:21:10 -0000 Received: (qmail 82653 invoked by uid 500); 26 Oct 2009 05:21:09 -0000 Delivered-To: dustinhughes@example.org Received: (qmail 82538 invoked by uid 500); 26 Oct 2009 05:21:09 -0000 Mailing-List: contact dustinhughes@example.org; run by ezmlm Precedence: bulk list-help: <mailto:dustinhughes@example.org> list-unsubscribe: <mailto:dustinhughes@example.org> List-Post: <mailto:dustinhughes@example.org> Reply-To: "Logging General" <dustinhughes@example.org> List-Id: <general.logging.apache.org> Delivered-To: mailing list dustinhughes@example.org Received: (qmail 82529 invoked by uid 99); 26 Oct 2009 05:21:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Oct 2009 05:21:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Oct 2009 05:21:00 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6EE8323888C2; Mon, 26 Oct 2009 05:20:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r829702 - in /logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw: ChainsawCyclicBufferTableModel.java EventContainer.java LogPanel.java TableColorizingRenderer.java Date: Mon, 26 Oct 2009 05:20:39 -0000 To: dustinhughes@example.org From: dustinhughes@example.org X-Mailer: svnmailer-1.0.8 Message-Id: <dustinhughes@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sdeboy Date: Mon Oct 26 05:20:38 2009 New Revision: 829702 URL: http://svn.apache.org/viewvc?rev=829702&view=rev Log: Fix bug preventing properties from not being displayed correctly in the table Add 'marker' column to the table when a marker is set Changed default text in marker column to 'set' Marker column is now editable (double-click cell) (Marker values are re-loaded if events are saved & reopened later) Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawCyclicBufferTableModel.java logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/EventContainer.java logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/TableColorizingRenderer.java 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=829702&r1=829701&r2=829702&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 Mon Oct 26 05:20:38 2009 @@ -342,7 +342,7 @@ LoggingEvent event = (LoggingEvent)filteredList.get(i); Object result = event.removeProperty(propName); if (result != null) { - fireRowUpdated(i); + fireRowUpdated(i, false); } } } @@ -501,34 +501,39 @@ } } - /** - * Is this a new Property key we haven't seen before? Remember that now MDC has been merged - * into the Properties collection - */ - boolean newColumn = uniquePropertyKeys.addAll(e.getPropertyKeySet()); + checkForNewColumn(e); + + return rowAdded; + } - if (newColumn) { + private void checkForNewColumn(LoggingEvent e) + { /** - * If so, we should add them as columns and notify listeners. + * Is this a new Property key we haven't seen before? Remember that now MDC has been merged + * into the Properties collection */ - for (Iterator iter = e.getPropertyKeySet().iterator(); iter.hasNext();) { - String key = iter.next().toString().toUpperCase(); + boolean newColumn = uniquePropertyKeys.addAll(e.getPropertyKeySet()); - //add all keys except the 'log4jid' key (columnNames is all-caps) - if (!columnNames.contains(key) && !(Constants.LOG4J_ID_KEY.equalsIgnoreCase(key))) { - columnNames.add(key); - logger.debug("Adding col '" + key + "', columnNames=" + columnNames); - fireNewKeyColumnAdded( - new NewKeyEvent( - this, columnNames.indexOf(key), key, e.getProperty(key))); + if (newColumn) { + /** + * If
{'source': 'Apache Software Foundation Public Mail Archives'}