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 Curt Arnold <ca...@apache.org> on 2007/01/30 22:41:12 UTC

svn commit: r500456 - in logging/log4j/trunk bug 30950

r500456 | eross | 2007-01-26 20:33:18 -0600 (Fri, 26 Jan 2007) | 1 line

Bug 30950 - Add non-throwable l7dlog

Index: src/java/org/apache/log4j/Category.java
===================================================================
1076a1077,1087
 >    * Log a localized message. The user supplied parameter  
<code>key</code> is
 >    * replaced by its localized version from the resource bundle.
 >    *
 >    * @see #setResourceBundle
 >    * @since 1.3
 >    */
 >   public void l7dlog(final Priority level, String key) {
 >     l7dlog(level, key, null, null);
 >   }
 >
 >   /**
1085,1086c1096
<   public void l7dlog(
<     Priority level, String key, Object[] params, Throwable t) {
---
 >   public void l7dlog(Priority level, String key, Object[] params,  
Throwable t) {
1087a1098
 >   }
1088a1100,1110
 >   /**
 >    * Log a localized and parameterized message. First, the user  
supplied
 >    * <code>key</code> is searched in the resource bundle. Next,  
the resulting
 >    * pattern is formatted using {@link
 >    * java.text.MessageFormat#format(String,Object[])} method with  
the user
 >    * supplied object array <code>params</code>.
 >    *
 >    * @since 1.3
 >    */
 >   public void l7dlog(Priority level, String key, Object[] params) {
 >     l7dlog(FQCN, level, key, params, null);
Index: tests/src/java/org/apache/log4j/CategoryTest.java
===================================================================
86c86,94
<     logger.l7dlog(debug, "test", null);
---
 >     logger.l7dlog(debug, "test", (Throwable)null);
 >     assertEquals("This is the English, US test.", sw.toString 
().trim());
 >   }
 >
 >   /**
 >    * Tests l7dlog(Priority, String) log.
 >    */
 >   public void testL7dlog2() {
 >     logger.l7dlog(debug, "test");
94c102
<     logger.l7dlog(debug, "XYZ", null);
---
 >     logger.l7dlog(debug, "XYZ", (Throwable)null);
103c111
<     logger.l7dlog(debug, "msg1", null);
---
 >     logger.l7dlog(debug, "msg1", (Throwable)null);
116a125,133
 >    * Tests l7dlog(FQN, Priority, String, Object[]) log.
 >    */
 >   public void testL7dlogFormat2() {
 >     Object o[] = new Object[] { new Integer(1), "X" };
 >     logger.l7dlog(debug, "msg1", o);
 >     assertEquals("This is test number 1 with string argument X. ",  
sw.toString());
 >   }
 >
 >   /**


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org