logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r915204 - in /logging/chainsaw/trunk/src/main: java/org/apache/log4j/chainsaw/ resources/org/apache/log4j/chainsaw/ resources/org/apache/log4j/chainsaw/help/ resources/org/apache/log4j/chainsaw/prefs/
Date Tue, 23 Feb 2010 06:48:04 GMT
Author: sdeboy
Date: Tue Feb 23 06:48:03 2010
New Revision: 915204

URL: http://svn.apache.org/viewvc?rev=915204&view=rev
Log:
- log4j.marker column is now displayed as the second column by default, making it easier to
add notes/annotate a log
- removed 'checkfornewerversion' popup, replaced with text on the welcome panel directing
users to the help menu for release notes and tutorial
- updated release notes

Modified:
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawColumns.java
    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/LogPanel.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/TableColorizingRenderer.java
    logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/WelcomePanel.html
    logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/release-notes.html
    logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/prefs/default.properties

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawColumns.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawColumns.java?rev=915204&r1=915203&r2=915204&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawColumns.java (original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawColumns.java Tue
Feb 23 06:48:03 2010
@@ -37,6 +37,7 @@
 
   static {
     columnNames.add(ChainsawConstants.LOGGER_COL_NAME);
+    columnNames.add(ChainsawConstants.LOG4J_MARKER_COL_NAME);
     columnNames.add(ChainsawConstants.TIMESTAMP_COL_NAME);
     columnNames.add(ChainsawConstants.LEVEL_COL_NAME);
     columnNames.add(ChainsawConstants.THREAD_COL_NAME);
@@ -53,17 +54,18 @@
   }
 
   public static final int INDEX_LOGGER_COL_NAME = 1;
-  public static final int INDEX_TIMESTAMP_COL_NAME = 2;
-  public static final int INDEX_LEVEL_COL_NAME = 3;
-  public static final int INDEX_THREAD_COL_NAME = 4;
-  public static final int INDEX_MESSAGE_COL_NAME = 5;
-  public static final int INDEX_NDC_COL_NAME = 6;
-  public static final int INDEX_THROWABLE_COL_NAME = 7;
-  public static final int INDEX_CLASS_COL_NAME = 8;
-  public static final int INDEX_METHOD_COL_NAME = 9;
-  public static final int INDEX_FILE_COL_NAME = 10;
-  public static final int INDEX_LINE_COL_NAME = 11;
-  public static final int INDEX_ID_COL_NAME = 12;
+  public static final int INDEX_LOG4J_MARKER_COL_NAME = 2;
+  public static final int INDEX_TIMESTAMP_COL_NAME = 3;
+  public static final int INDEX_LEVEL_COL_NAME = 4;
+  public static final int INDEX_THREAD_COL_NAME = 5;
+  public static final int INDEX_MESSAGE_COL_NAME = 6;
+  public static final int INDEX_NDC_COL_NAME = 7;
+  public static final int INDEX_THROWABLE_COL_NAME = 8;
+  public static final int INDEX_CLASS_COL_NAME = 9;
+  public static final int INDEX_METHOD_COL_NAME = 10;
+  public static final int INDEX_FILE_COL_NAME = 11;
+  public static final int INDEX_LINE_COL_NAME = 12;
+  public static final int INDEX_ID_COL_NAME = 13;
 
  public static final Cursor CURSOR_FOCUS_ON;
  static{

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=915204&r1=915203&r2=915204&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
Tue Feb 23 06:48:03 2010
@@ -57,6 +57,7 @@
 
   //COLUMN NAMES
   static final String LOGGER_COL_NAME = "LOGGER";
+  static final String LOG4J_MARKER_COL_NAME = "LOG4J.MARKER";
   static final String TIMESTAMP_COL_NAME = "TIMESTAMP";
   static final String LEVEL_COL_NAME = "LEVEL";
   static final String THREAD_COL_NAME = "THREAD";
@@ -81,7 +82,6 @@
   static final String LEVEL_DISPLAY_ICONS = "icons";
   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=915204&r1=915203&r2=915204&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 Feb 23 06:48:03 2010
@@ -409,6 +409,9 @@
     case ChainsawColumns.INDEX_LEVEL_COL_NAME:
       return event.getLevel();
 
+    case ChainsawColumns.INDEX_LOG4J_MARKER_COL_NAME:
+      return event.getProperty(ChainsawConstants.LOG4J_MARKER_COL_NAME);
+
     case ChainsawColumns.INDEX_LOGGER_COL_NAME:
       return event.getLoggerName();
 
@@ -627,13 +630,13 @@
       return true;
     }
 
+    if (getColumnName(columnIndex).equals(ChainsawConstants.LOG4J_MARKER_COL_NAME)) {
+      return true;
+    }
+
     if (columnIndex >= columnNames.size()) {
         return false;
     }
-    String columnName = getColumnName(columnIndex);
-    if (columnName.toLowerCase().equals(ChainsawConstants.MARKER_PROPERTY_NAME)) {
-      return true;
-    }
 
     return super.isCellEditable(rowIndex, columnIndex);
   }

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=915204&r1=915203&r2=915204&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 Feb 23
06:48:03 2010
@@ -1038,7 +1038,7 @@
             
         }
     });
-    findMarkerRule = ExpressionRule.getRule("prop." + ChainsawConstants.MARKER_PROPERTY_NAME
+ " exists");
+    findMarkerRule = ExpressionRule.getRule("prop." + ChainsawConstants.LOG4J_MARKER_COL_NAME
+ " exists");
         
     tableModel.addTableModelListener(new TableModelListener() {
 		public void tableChanged(TableModelEvent e) {
@@ -2518,18 +2518,18 @@
     }
 
     public void clearAllMarkers() {
-        tableModel.removePropertyFromEvents(ChainsawConstants.MARKER_PROPERTY_NAME);
+        tableModel.removePropertyFromEvents(ChainsawConstants.LOG4J_MARKER_COL_NAME);
     }
 
     public void toggleMarker() {
         int row = table.getSelectedRow();
         if (row != -1) {
           LoggingEvent event = tableModel.getRow(row);
-          Object marker = event.getProperty(ChainsawConstants.MARKER_PROPERTY_NAME);
+          Object marker = event.getProperty(ChainsawConstants.LOG4J_MARKER_COL_NAME);
           if (marker == null) {
-              event.setProperty(ChainsawConstants.MARKER_PROPERTY_NAME, "set");
+              event.setProperty(ChainsawConstants.LOG4J_MARKER_COL_NAME, "set");
           } else {
-              event.removeProperty(ChainsawConstants.MARKER_PROPERTY_NAME);
+              event.removeProperty(ChainsawConstants.LOG4J_MARKER_COL_NAME);
           }
           //if marker -was- null, it no longer is (may need to add the column)
           tableModel.fireRowUpdated(row, (marker == null));
@@ -2660,11 +2660,11 @@
               int row = table.rowAtPoint(evt.getPoint());
               if (row != -1) {
                 LoggingEvent event = tableModel.getRow(row);
-                Object marker = event.getProperty(ChainsawConstants.MARKER_PROPERTY_NAME);
+                Object marker = event.getProperty(ChainsawConstants.LOG4J_MARKER_COL_NAME);
                 if (marker == null) {
-                    event.setProperty(ChainsawConstants.MARKER_PROPERTY_NAME, "set");
+                    event.setProperty(ChainsawConstants.LOG4J_MARKER_COL_NAME, "set");
                 } else {
-                    event.removeProperty(ChainsawConstants.MARKER_PROPERTY_NAME);
+                    event.removeProperty(ChainsawConstants.LOG4J_MARKER_COL_NAME);
                 }
                 //if marker -was- null, it no longer is (may need to add the column)
                 tableModel.fireRowUpdated(row, (marker == null));
@@ -2737,7 +2737,7 @@
           (column.getModelIndex() + 1) == ChainsawColumns.INDEX_THROWABLE_COL_NAME) {
           column.setCellEditor(throwableRenderPanel);
         }
-        if (column.getHeaderValue().toString().toLowerCase().equals(ChainsawConstants.MARKER_PROPERTY_NAME))
{
+        if (column.getHeaderValue().toString().equals(ChainsawConstants.LOG4J_MARKER_COL_NAME))
{
           column.setCellEditor(markerCellEditor);
         }
       }
@@ -2888,9 +2888,9 @@
         public boolean stopCellEditing()
         {
             if (textField.getText().trim().equals("")) {
-                currentEvent.removeProperty(ChainsawConstants.MARKER_PROPERTY_NAME);
+                currentEvent.removeProperty(ChainsawConstants.LOG4J_MARKER_COL_NAME);
             } else {
-                currentEvent.setProperty(ChainsawConstants.MARKER_PROPERTY_NAME, textField.getText());
+                currentEvent.setProperty(ChainsawConstants.LOG4J_MARKER_COL_NAME, textField.getText());
             }
             ChangeEvent event = new ChangeEvent(table);
             for (Iterator iter = cellEditorListeners.iterator();iter.hasNext();) {
@@ -2920,7 +2920,7 @@
         public Component getTableCellEditorComponent(JTable table, Object value, boolean
isSelected, int row, int column)
         {
             currentEvent = tableModel.getRow(row);
-            textField.setText(currentEvent.getProperty(ChainsawConstants.MARKER_PROPERTY_NAME));
+            textField.setText(currentEvent.getProperty(ChainsawConstants.LOG4J_MARKER_COL_NAME));
             textField.selectAll();
             return textField;
         }

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java?rev=915204&r1=915203&r2=915204&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java (original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java Tue Feb 23 06:48:03
2010
@@ -417,8 +417,6 @@
 
     logger.info("SecurityManager is now: " + System.getSecurityManager());
 
-    logUI.checkForNewerVersion();
-    
     if (newShutdownAction != null) {
       logUI.setShutdownAction(newShutdownAction);
     } else {
@@ -1157,34 +1155,6 @@
 
   }
 
-  /**
-   * Checks the last run version number against this compiled version number and prompts
the user
-   * to view the release notes if the 2 strings are different.
-   */
-  private void checkForNewerVersion()
-  {
-      /**
-       * Now check if the version they last used (if any) is
-       * different than the version that is currently running
-       */
-      
-      String lastUsedVersion = getApplicationPreferenceModel().getLastUsedVersion();
-      String currentVersionNumber = VersionManager.getInstance().getVersionNumber();
-      if(lastUsedVersion==null || !lastUsedVersion.equals(currentVersionNumber)) {
-          if(JOptionPane.showConfirmDialog(this, "This version looks like it is different
than the version you last ran. (" + lastUsedVersion + " vs " + currentVersionNumber+")\n\nWould
you like to view the Release Notes?", "Newer Version?", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION)
{
-              SwingUtilities.invokeLater(new Runnable() {
-                  
-                  public void run()
-                  {
-                      HelpManager.getInstance().setHelpURL(ChainsawConstants.RELEASE_NOTES_URL);
-                      
-                  }});
-          }
-      }
-      // Lets set this new version as the current version so we don't get nagged all the
time...
-      getApplicationPreferenceModel().setLastUsedVersion(currentVersionNumber);
-  }
-
 /**
    * Display the log tree pane, using the last known divider location
    */

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=915204&r1=915203&r2=915204&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
Tue Feb 23 06:48:03 2010
@@ -135,6 +135,7 @@
 
     c.setText(logger.substring(startPos + 1));
       break;
+    case ChainsawColumns.INDEX_LOG4J_MARKER_COL_NAME:
     case ChainsawColumns.INDEX_CLASS_COL_NAME:
     case ChainsawColumns.INDEX_FILE_COL_NAME:
     case ChainsawColumns.INDEX_LINE_COL_NAME:
@@ -192,7 +193,7 @@
     }
     //set the 'marker' icon next to the zeroth column if marker is set
     if (col == 0) {
-      if (event.getProperty(ChainsawConstants.MARKER_PROPERTY_NAME) != null) {
+      if (event.getProperty(ChainsawConstants.LOG4J_MARKER_COL_NAME) != null) {
         c.setIcon(markerIcon);
       } else {
         //only null out the column if it's not the level field

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=915204&r1=915203&r2=915204&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
Tue Feb 23 06:48:03 2010
@@ -10,6 +10,10 @@
 		<td><b><font size="+2">Chainsaw v2</font></b> - brought to
you by the Log4j Dev team</td>
 		<!--<td rowspan="2" align="right"><img align="top" src="logo.jpg" border="0"
alt="Log4j Logo"></td>-->
 	</tr>
+    <tr/>
+    <tr>
+        <td><b>Release notes and tutorial are available from the Help menu</b></td>
+    </tr>
 </table></p>
 <!-- Removing this until we can work out why the Anchor tags don't work in Swing... -->
 <!--
@@ -87,7 +91,7 @@
     <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 colspan="1">Define a 'marker' (add a note to a row)</td>
         <td nowrap class="HotKey">F2</td>
         <td width="50" align="center">-</td>
         <td colspan="1">Find next marker</td>

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=915204&r1=915203&r2=915204&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
Tue Feb 23 06:48:03 2010
@@ -7,9 +7,24 @@
 <BODY>
 <h1>Release Notes</h1>
 <br>
-<b>NOTE:</b> The mechanism and format used to persist settings in Chainsaw is
subject to change during this alpha phase.  If you are experiencing problems displaying events
in Chainsaw, please delete everything in the $user.dir/.chainsaw directory.
+<b>NOTE:</b> The mechanism and format used to persist settings in Chainsaw is
subject to change.  If you are experiencing problems displaying events in Chainsaw, please
delete everything in the $user.dir/.chainsaw directory and restart Chainsaw.
 <br>
 <h1>1.99.99</h2>
+<h2>22 Feb 2010</h2>
+<ul>
+<li>Implemented marker support (ability to add notes to rows).  Double click a row
to toggle on or off a default note, or click in a row to define a custom note.  Navigate between
markers with F2/Shift F2.
+    If you want to use these markers to colorize or build custom search expressions, use
the column key PROP.log4j.marker.
+    Markers are saved and reloaded through the file-save as and file-load log4j file menus.
+</li>
+<li>Auto-configuration URL field now remembers the 10 most recent configuration files
and provides a 'browse' button to load a configuration file without typing the URL.
+</li>
+<li>Tab color rules can now be copied to another tab.
+</li>
+<li>Updated default colors to lighter shades and default colors for WARN and FATAL/ERROR
rows. 
+</li>
+<li>Added 'find next' and 'clear find next' menu items to logger tree and log panel
popup. 
+</li>
+</ul>
 <h2>02 March 2006</h2>
 <ul>
 <li>Fixed distribution mechanism so that DB and JMS receiver stuff can also be supported
in Webstart mode.</li>

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=915204&r1=915203&r2=915204&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 Feb 23 06:48:03 2010
@@ -9,8 +9,8 @@
 main.window.width=1024
 main.window.height=768
 
-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
+table.columns.order=ID,TIMESTAMP,LOG4J.MARKER,LEVEL,LOGGER,MESSAGE,THROWABLE,THREAD,NDC,CLASS,METHOD,FILE,LINE
+table.columns.widths=50,150,150,50,100,300,100,150,150,300,150,100,100
 
 SavedConfigs.Size=0
 DateFormat.1=HH:mm:ss



Mime
View raw message