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 [EMAIL PROTECTED]
> * 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to