jmcnally    01/12/19 10:41:17

  Modified:    src/java/org/apache/torque/om BaseObject.java
  Log:
  convenience method to get a log4j Category.  The category is based on
  class name.  Log messages in classes extending BaseObject are likely to
  be related to business logic and not related to torque.
  
  Revision  Changes    Path
  1.7       +12 -1     
jakarta-turbine-torque/src/java/org/apache/torque/om/BaseObject.java
  
  Index: BaseObject.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/om/BaseObject.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- BaseObject.java   2001/10/30 00:07:37     1.6
  +++ BaseObject.java   2001/12/19 18:41:17     1.7
  @@ -56,6 +56,7 @@
   
   import java.io.Serializable;
   import java.math.BigDecimal;
  +import org.apache.log4j.Category;
   import org.apache.torque.pool.DBConnection;
   
   /**
  @@ -64,7 +65,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Frank Y. Kim</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>John D. McNally</a>
  - * @version $Id: BaseObject.java,v 1.6 2001/10/30 00:07:37 jmcnally Exp $
  + * @version $Id: BaseObject.java,v 1.7 2001/12/19 18:41:17 jmcnally Exp $
    */
   public abstract class BaseObject implements Persistent, Serializable
   {
  @@ -407,6 +408,16 @@
           }
   
           return ok.hashCode();
  +    }
  +
  +    /**
  +     * gets a log4j Category based on class name.
  +     *
  +     * @return a <code>Category</code> to write log to.
  +     */
  +    protected Category getCategory()
  +    {
  +             return Category.getInstance(getClass().getName());
       }
   
       /**
  
  
  

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

Reply via email to