struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@locus.apache.org
Subject cvs commit: jakarta-struts/src/share/org/apache/struts/action ActionServlet.java
Date Sun, 01 Oct 2000 00:47:04 GMT
craigmcc    00/09/30 17:47:04

  Modified:    src/share/org/apache/struts/action ActionServlet.java
  Log:
  Add a log() method to ActionServlet that also takes a debugging detail level.
  If you have set the "debug" initialization parameter to a value greater than
  or equal to the specified level, this message will be logged -- otherwise it
  will be ignored.
  
  NOTE:  While this method is convenient, it is generally more efficient to do
  the conditional test in your action, prior to calling this log() method which
  often includes string concatenations to construct the message string.
  
  Submitted by: Roberg Leleand <Robert@freetocreate.org>
  
  Revision  Changes    Path
  1.25      +20 -4     jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java
  
  Index: ActionServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- ActionServlet.java	2000/09/26 23:26:20	1.24
  +++ ActionServlet.java	2000/10/01 00:47:03	1.25
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v
1.24 2000/09/26 23:26:20 craigmcc Exp $
  - * $Revision: 1.24 $
  - * $Date: 2000/09/26 23:26:20 $
  + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v
1.25 2000/10/01 00:47:03 craigmcc Exp $
  + * $Revision: 1.25 $
  + * $Date: 2000/10/01 00:47:03 $
    *
    * ====================================================================
    *
  @@ -199,7 +199,7 @@
    * </ul>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.24 $ $Date: 2000/09/26 23:26:20 $
  + * @version $Revision: 1.25 $ $Date: 2000/10/01 00:47:03 $
    */
   
   public class ActionServlet
  @@ -526,6 +526,22 @@
       public MessageResources getResources() {
   
   	return (application);
  +
  +    }
  +
  +
  +    /**
  +     * Log the specified message if the current debugging detail level for
  +     * this servlet has been set to an equal or higher value.  Otherwise,
  +     * ignore this message.
  +     *
  +     * @param message Message to be logged
  +     * @param level Debugging detail level of this message
  +     */
  +    public void log(String message, int level) {
  +
  +        if (debug >= level)
  +            log(message);
   
       }
   
  
  
  

Mime
View raw message