You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by mw...@apache.org on 2003/03/20 06:37:52 UTC
cvs commit: jakarta-log4j/src/java/org/apache/log4j/spi LoggingEvent.java
mwomack 2003/03/19 21:37:52
Modified: src/java/org/apache/log4j/spi LoggingEvent.java
Log:
Added getPropertyKeySet() method to return an unmodifiable set of the keys in the event properties. If the properties is null, then an empty set is returned.
Revision Changes Path
1.38 +16 -1 jakarta-log4j/src/java/org/apache/log4j/spi/LoggingEvent.java
Index: LoggingEvent.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/spi/LoggingEvent.java,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- LoggingEvent.java 19 Mar 2003 06:02:59 -0000 1.37
+++ LoggingEvent.java 20 Mar 2003 05:37:52 -0000 1.38
@@ -360,7 +360,7 @@
* Returns the set of of the key values in the MDC for the event.
* The returned set is unmodifiable by the caller.
*
- * @return Iterator an iterator to iterate over the MDC keys.
+ * @return Set an unmodifiable set of the MDC keys.
* @since 1.3
*/
public Set getMDCKeySet() {
@@ -404,6 +404,21 @@
return null;
} else {
return (String) properties.get(key);
+ }
+ }
+
+ /**
+ * Returns the set of of the key values in the properties
+ * for the event. The returned set is unmodifiable by the caller.
+ *
+ * @return Set an unmodifiable set of the property keys.
+ * @since 1.3
+ */
+ public Set getPropertyKeySet() {
+ if (properties != null) {
+ return Collections.unmodifiableSet(properties.keySet());
+ } else {
+ return Collections.EMPTY_SET;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org