logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r952117 - in /logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw: ChainsawCyclicBufferTableModel.java LogPanel.java
Date Mon, 07 Jun 2010 06:37:36 GMT
Author: sdeboy
Date: Mon Jun  7 06:37:36 2010
New Revision: 952117

URL: http://svn.apache.org/viewvc?rev=952117&view=rev
Log:
lookup of properties 'under the pointer' (refine-focus or search from table's context menu)
were failing to resolve the value because of case sensitivity...look up case-sensitive first
and fall back to case insensitive for property lookups in the table model
Also added marker to column/name keyword map (used during search via context menu)

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

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=952117&r1=952116&r2=952117&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 Jun  7 06:37:36 2010
@@ -27,6 +27,7 @@ import java.util.Date;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 import javax.swing.ProgressMonitor;
@@ -543,10 +544,23 @@ class ChainsawCyclicBufferTableModel ext
     default:
 
       if (columnIndex < columnNames.size()) {
-        return event.getProperty(columnNames.get(columnIndex).toString());
+        //case may not match..try case sensitive and fall back to case-insensitive
+        String result = event.getProperty(columnNames.get(columnIndex).toString());
+        if (result == null) {
+            String lowerColName = columnNames.get(columnIndex).toString().toLowerCase();
+            Set entrySet = event.getProperties().entrySet();
+            for (Iterator iter = entrySet.iterator();iter.hasNext();) {
+                Map.Entry thisEntry = (Map.Entry) iter.next();
+                if (thisEntry.getKey().toString().toLowerCase().equals(lowerColName)) {
+                    result = thisEntry.getValue().toString();
+                }
+            }
+        }
+        if (result != null) {
+            return result;
+        }
       }
     }
-
     return "";
   }
 

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=952117&r1=952116&r2=952117&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java (original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java Mon Jun 
7 06:37:36 2010
@@ -288,6 +288,7 @@ public class LogPanel extends DockablePa
     columnNameKeywordMap.put(ChainsawConstants.THREAD_COL_NAME, LoggingEventFieldResolver.THREAD_FIELD);
     columnNameKeywordMap.put(ChainsawConstants.THROWABLE_COL_NAME, LoggingEventFieldResolver.EXCEPTION_FIELD);
     columnNameKeywordMap.put(ChainsawConstants.TIMESTAMP_COL_NAME, LoggingEventFieldResolver.TIMESTAMP_FIELD);
+    columnNameKeywordMap.put(ChainsawConstants.LOG4J_MARKER_COL_NAME_LOWERCASE.toUpperCase(),
LoggingEventFieldResolver.PROP_FIELD + ChainsawConstants.LOG4J_MARKER_COL_NAME_LOWERCASE);
 
     logPanelPreferencesFrame.setTitle("'" + identifier + "' Log Panel Preferences");
     logPanelPreferencesFrame.setIconImage(



Mime
View raw message