excalibur-diffs.txt:
- patch to fix paths in build.sh for jdbcdatasource example (need to set
execute bit on this)
- patch to catch NPE if context isn't set and throw more useful
ConfigurationException instead in FileTargetFactory and
ServletTargetFactory and minor JavaDoc edits

logkit-diffs.txt:
- patch to edit JavaDoc for PatternFormater

-Mark
Index: examples/jdbcdatasource/build.sh
===================================================================
RCS file: /home/cvspublic/jakarta-avalon-excalibur/examples/jdbcdatasource/build.sh,v
retrieving revision 1.1
diff -u -r1.1 build.sh
--- examples/jdbcdatasource/build.sh    7 Feb 2002 07:15:41 -0000       1.1
+++ examples/jdbcdatasource/build.sh    10 Feb 2002 11:16:12 -0000
@@ -3,11 +3,11 @@
 LOCAL_AVALON_TOOLS=$AVALON_TOOLS
 
 if [ "$AVALON_TOOLS" = "" ] ; then
-    if [ -d ../../jakarta-avalon/tools ] ; then
-        LOCAL_AVALON_TOOLS=../../jakarta-avalon/tools
+    if [ -d ../../../jakarta-avalon/tools ] ; then
+        LOCAL_AVALON_TOOLS=../../../jakarta-avalon/tools
     else
         echo "Unable to locate tools directory at "
-        echo "../../jakarta-avalon/tools/"
+        echo "../../../jakarta-avalon/tools/"
         echo "Aborting."
         exit 1
     fi
Index: src/java/org/apache/avalon/excalibur/logger/factory/FileTargetFactory.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/logger/factory/FileTargetFactory.java,v
retrieving revision 1.10
diff -u -r1.10 FileTargetFactory.java
--- src/java/org/apache/avalon/excalibur/logger/factory/FileTargetFactory.java  9 Feb 
2002 00:29:57 -0000       1.10
+++ src/java/org/apache/avalon/excalibur/logger/factory/FileTargetFactory.java  10 Feb 
+2002 11:16:12 -0000
@@ -291,11 +291,11 @@
     }
 
     /**
-     * Process the file name
+     * Process the file name.
      *
      * This method scans the file name passed for occurrences of
-     * ${foo}. Those strings get replaced by values from the Context object
-     * indexted by the name (here foo).
+     * ${foo}.  These strings get replaced by values from the Context
+     * object indexed by the name (here foo).
      *
      * @param rawFilename The filename with substitutable placeholders
      * @return The processed file name
@@ -310,6 +310,9 @@
         int j = -1;
         while( ( j = rawFilename.indexOf( "${", i ) ) > -1 )
         {
+            if( m_context == null ) {
+                throw new ConfigurationException( "Context not available." );
+            }
             if( i < j )
             {
                 sb.append( rawFilename.substring( i, j ) );
@@ -323,7 +326,7 @@
             }
             catch( final ContextException ce )
             {
-                throw new ConfigurationException( "missing entry '" + ctx_name + "' 
in Context" );
+                throw new ConfigurationException( "Missing entry '" + ctx_name + "' 
+in Context." );
             }
             sb.append( ctx.toString() );
             i = k + 1;
Index: src/java/org/apache/avalon/excalibur/logger/factory/ServletTargetFactory.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/logger/factory/ServletTargetFactory.java,v
retrieving revision 1.5
diff -u -r1.5 ServletTargetFactory.java
--- src/java/org/apache/avalon/excalibur/logger/factory/ServletTargetFactory.java      
 9 Feb 2002 00:29:57 -0000       1.5
+++ src/java/org/apache/avalon/excalibur/logger/factory/ServletTargetFactory.java      
+ 10 Feb 2002 11:16:12 -0000
@@ -19,11 +19,10 @@
 import org.apache.log.output.ServletOutputLogTarget;
 
 /**
- * ServletTargetFactory class.
- *
- * This factory creates a ServletOutputLogTargets. It uses the context-key attribute
- * to locate the ServletContext needed out of the Context object passed to this 
factory.
- * The default context-key is "servlet-context".
+ * This factory creates a ServletOutputLogTargets. It uses the
+ * context-key attribute to locate the required ServletContext from
+ * the Context object passed to this factory.  The default context-key
+ * is <code>servlet-context</code>.
  *
  * <pre>
  *
@@ -58,6 +57,9 @@
     public final LogTarget createTarget( final Configuration configuration )
         throws ConfigurationException
     {
+        if( m_context == null ) {
+            throw new ConfigurationException( "Context not available." );
+        }
         final String contextkey = 
             m_configuration.getAttribute( "context-key", "servlet-context" );
         final ServletContext sctx;
Index: src/java/org/apache/log/format/PatternFormatter.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-logkit/src/java/org/apache/log/format/PatternFormatter.java,v
retrieving revision 1.25
diff -u -r1.25 PatternFormatter.java
--- src/java/org/apache/log/format/PatternFormatter.java        9 Feb 2002 21:40:24 
-0000       1.25
+++ src/java/org/apache/log/format/PatternFormatter.java        10 Feb 2002 10:07:16 
+-0000
@@ -77,20 +77,22 @@
  *     </table>
  *   </p></li>
  * </ul>
- * <p>A simple example of a typical PatternFormatter format:
- * <code>%{time} %5.5{priority}[%-10.10{category}]: %{message}</code>
+ * <p>A simple example of a typical PatternFormatter format would be:
+ * <pre><code>
+ *   %{time} %5.5{priority}[%-10.10{category}]: %{message}
+ * </code></pre>
+ * This would produce a line like:
+ * <pre><code>
+ *   1000928827905 DEBUG [     junit]: Sample message
+ * </code></pre>
+ * </p><p>
+ * The format string specifies that the logger should first print the
+ * time value of the log event without size restriction, then the
+ * priority of the log event with a minimum and maximum size of 5, 
+ * then the category of the log event right justified with a minimum
+ * and maximum size of 10, followed by the message of the log event
+ * without any size restriction.
  * </p>
- * <p>
- *   This format string will format a log event printing first time value of
- *   of log event with out size restriction, next priority with minum and maximum 
size 5,
- *   next category right justified having minmum and maximum size of 10,
- *   at last the message of the log event without size restriction.
- * </p>
- * <p>A formatted sample message of the above pattern format:
- * </p>
- * <pre><code>1000928827905 DEBUG [     junit]: Sample message
- * </pre><code>
- *
  *
  * @author <a href="mailto:[EMAIL PROTECTED]";>Peter Donald</a>
  * @author <a href="mailto:[EMAIL PROTECTED]";>Sylvain Wallez</a>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to