You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by ba...@apache.org on 2006/10/25 02:56:14 UTC

svn commit: r467527 - in /jakarta/taglibs/proper/log/trunk: src/org/apache/taglibs/log/ xml/

Author: bayard
Date: Tue Oct 24 17:56:13 2006
New Revision: 467527

URL: http://svn.apache.org/viewvc?view=rev&rev=467527
Log:
Applying Scott Andrews' patch from Bugzilla issue #40500

Modified:
    jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/DebugTag.java
    jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/ErrorTag.java
    jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/FatalTag.java
    jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/InfoTag.java
    jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/LoggerTag.java
    jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/WarnTag.java
    jakarta/taglibs/proper/log/trunk/xml/log.xml

Modified: jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/DebugTag.java
URL: http://svn.apache.org/viewvc/jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/DebugTag.java?view=diff&rev=467527&r1=467526&r2=467527
==============================================================================
--- jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/DebugTag.java (original)
+++ jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/DebugTag.java Tue Oct 24 17:56:13 2006
@@ -33,5 +33,9 @@
     protected void log(Log logCategory, String message) {
         logCategory.debug(message);
     }
+
+    protected void log(Log logCategory, String message, Throwable t) {
+        logCategory.debug(message,t);
+    }
 }
 

Modified: jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/ErrorTag.java
URL: http://svn.apache.org/viewvc/jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/ErrorTag.java?view=diff&rev=467527&r1=467526&r2=467527
==============================================================================
--- jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/ErrorTag.java (original)
+++ jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/ErrorTag.java Tue Oct 24 17:56:13 2006
@@ -33,5 +33,9 @@
     protected void log(Log logCategory, String message) {
         logCategory.error(message);
     }
+
+    protected void log(Log logCategory, String message, Throwable t) {
+        logCategory.error(message,t);
+    }
 }
 

Modified: jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/FatalTag.java
URL: http://svn.apache.org/viewvc/jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/FatalTag.java?view=diff&rev=467527&r1=467526&r2=467527
==============================================================================
--- jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/FatalTag.java (original)
+++ jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/FatalTag.java Tue Oct 24 17:56:13 2006
@@ -33,5 +33,9 @@
     protected void log(Log logCategory, String message) {
         logCategory.fatal(message);
     }
+
+    protected void log(Log logCategory, String message, Throwable t) {
+        logCategory.fatal(message,t);
+    }
 }
 

Modified: jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/InfoTag.java
URL: http://svn.apache.org/viewvc/jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/InfoTag.java?view=diff&rev=467527&r1=467526&r2=467527
==============================================================================
--- jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/InfoTag.java (original)
+++ jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/InfoTag.java Tue Oct 24 17:56:13 2006
@@ -33,5 +33,9 @@
     protected void log(Log logCategory, String message) {
         logCategory.info(message);
     }
+
+    protected void log(Log logCategory, String message, Throwable t) {
+        logCategory.info(message,t);
+    }
 }
 

Modified: jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/LoggerTag.java
URL: http://svn.apache.org/viewvc/jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/LoggerTag.java?view=diff&rev=467527&r1=467526&r2=467527
==============================================================================
--- jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/LoggerTag.java (original)
+++ jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/LoggerTag.java Tue Oct 24 17:56:13 2006
@@ -34,6 +34,7 @@
     
     private String category;
     private String message;
+    private Throwable t;
 
     
     public void setCategory(String category) {
@@ -44,6 +45,10 @@
         this.message = message;
     }
     
+    public void setException(Throwable t) {
+        this.t = t;
+    }
+    
     // Tag interface
     //------------------------------------------------------------------------- 
     public int doStartTag() throws JspException  {
@@ -51,7 +56,11 @@
             Log logCategory = getLoggingCategory();
             if ( isEnabled( logCategory ) ) {
                 // Log now as doAfterBody() may not be called for an empty tag 
-                log( logCategory, message );
+                if ( t == null ) {
+                    log( logCategory, message );
+                } else {
+                    log( logCategory, message, t );
+                }
             }
             return SKIP_BODY;
         }
@@ -62,7 +71,11 @@
         if (message == null) {
             Log logCategory = getLoggingCategory();
             if ( isEnabled( logCategory ) ) {
-                log( logCategory, getBodyContent().getString().trim() );
+                if ( t == null ) {
+                    log( logCategory, getBodyContent().getString().trim() );
+                } else {
+                    log( logCategory, getBodyContent().getString().trim(), t );
+                }
             }
         }
         return SKIP_BODY;
@@ -72,6 +85,7 @@
     //------------------------------------------------------------------------- 
     protected abstract boolean isEnabled(Log logCategory);
     protected abstract void log(Log logCategory, String message);
+    protected abstract void log(Log logCategory, String message, Throwable t);
     
     protected Log getLoggingCategory() {
         if ( category == null ) {

Modified: jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/WarnTag.java
URL: http://svn.apache.org/viewvc/jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/WarnTag.java?view=diff&rev=467527&r1=467526&r2=467527
==============================================================================
--- jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/WarnTag.java (original)
+++ jakarta/taglibs/proper/log/trunk/src/org/apache/taglibs/log/WarnTag.java Tue Oct 24 17:56:13 2006
@@ -33,5 +33,9 @@
     protected void log(Log logCategory, String message) {
         logCategory.warn(message);
     }
+
+    protected void log(Log logCategory, String message, Throwable t) {
+        logCategory.warn(message,t);
+    }
 }
 

Modified: jakarta/taglibs/proper/log/trunk/xml/log.xml
URL: http://svn.apache.org/viewvc/jakarta/taglibs/proper/log/trunk/xml/log.xml?view=diff&rev=467527&r1=467526&r2=467527
==============================================================================
--- jakarta/taglibs/proper/log/trunk/xml/log.xml (original)
+++ jakarta/taglibs/proper/log/trunk/xml/log.xml Tue Oct 24 17:56:13 2006
@@ -118,6 +118,15 @@
           If this is not specified then the body of the tag is used instead.
         </description>
       </attribute>
+      <attribute>
+        <name>exception</name>
+        <rtexprvalue>true</rtexprvalue>
+        <required>false</required>
+        <description>
+          The exception to log. 
+          If this is not specified then only the message will be logged.
+        </description>
+      </attribute>
       <restrictions></restrictions>
       <example><usage>
           <comment>
@@ -157,6 +166,15 @@
           If this is not specified then the body of the tag is used instead.
         </description>
       </attribute>
+      <attribute>
+        <name>exception</name>
+        <rtexprvalue>true</rtexprvalue>
+        <required>false</required>
+        <description>
+          The exception to log. 
+          If this is not specified then only the message will be logged.
+        </description>
+      </attribute>
       <restrictions></restrictions>
       <example><usage>
           <comment>
@@ -196,6 +214,15 @@
           If this is not specified then the body of the tag is used instead.
         </description>
       </attribute>
+      <attribute>
+        <name>exception</name>
+        <rtexprvalue>true</rtexprvalue>
+        <required>false</required>
+        <description>
+          The exception to log. 
+          If this is not specified then only the message will be logged.
+        </description>
+      </attribute>
       <restrictions></restrictions>
       <example><usage>
           <comment>
@@ -235,6 +262,15 @@
           If this is not specified then the body of the tag is used instead.
         </description>
       </attribute>
+      <attribute>
+        <name>exception</name>
+        <rtexprvalue>true</rtexprvalue>
+        <required>false</required>
+        <description>
+          The exception to log. 
+          If this is not specified then only the message will be logged.
+        </description>
+      </attribute>
       <restrictions></restrictions>
       <example><usage>
           <comment>
@@ -272,6 +308,15 @@
         <description>
           The message to log. 
           If this is not specified then the body of the tag is used instead.
+        </description>
+      </attribute>
+      <attribute>
+        <name>exception</name>
+        <rtexprvalue>true</rtexprvalue>
+        <required>false</required>
+        <description>
+          The exception to log. 
+          If this is not specified then only the message will be logged.
         </description>
       </attribute>
       <restrictions></restrictions>



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