psmith      2004/08/25 15:26:22

  Modified:    src/java/org/apache/log4j Category.java
  Log:
  Following on from Yoav's effort, added the 'isTraceEnabled' method inline with 
isDebugEnabled as requested in Bug #30850.
  
  PR: 30850
  
  Revision  Changes    Path
  1.88      +18 -3     logging-log4j/src/java/org/apache/log4j/Category.java
  
  Index: Category.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/Category.java,v
  retrieving revision 1.87
  retrieving revision 1.88
  diff -u -r1.87 -r1.88
  --- Category.java     9 Aug 2004 14:29:32 -0000       1.87
  +++ Category.java     25 Aug 2004 22:26:22 -0000      1.88
  @@ -853,8 +853,23 @@
     }
   
     /**
  +   * Check whether this category is enabled for the TRACE  Level. See also
  +   * [EMAIL PROTECTED] #isDebugEnabled()}.
  +   *
  +   * @return boolean - <code>true</code> if this category is enabled for level
  +   *         TRACE, <code>false</code> otherwise.
  +   */
  +  public boolean isTraceEnabled() {
  +      if (repository.isDisabled(Level.TRACE_INT)) {
  +          return false;
  +        }
  +
  +        return Level.TRACE.isGreaterOrEqual(this.getEffectiveLevel());
  +  }
  +
  +  /**
      * Check whether this category is enabled for a given [EMAIL PROTECTED] Level} 
passed
  -   * as parameter. See also [EMAIL PROTECTED] #isDebugEnabled}.
  +   * as parameter. See also [EMAIL PROTECTED] #isDebugEnabled()}.
      *
      * @return boolean True if this logger is enabled for <code>level</code>.
      */
  @@ -875,7 +890,7 @@
     
     /**
      * Check whether this category is enabled for the info Level. See also
  -   * [EMAIL PROTECTED] #isDebugEnabled}.
  +   * [EMAIL PROTECTED] #isDebugEnabled()}.
      *
      * @return boolean - <code>true</code> if this category is enabled for level
      *         info, <code>false</code> otherwise.
  @@ -887,7 +902,7 @@
   
       return Level.INFO.isGreaterOrEqual(this.getEffectiveLevel());
     }
  -
  +  
     /**
      * Log a localized message. The user supplied parameter <code>key</code> is
      * replaced by its localized version from the resource bundle.
  
  
  

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

Reply via email to