logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject Re: cvs commit: logging-log4j/tests/src/java/org/apache/log4j LoggerTestCase.java StressCategory.java
Date Thu, 05 Aug 2004 18:05:22 GMT

Hi Yoav,

A few comments about your commit.

First, the new trace methods should be added to Logger and not Category. 
Remember that log4j will always produce Logger instances and never pure 
Category instances.

Second, the commit message contains massive amount of changes due probably 
to white space issues. Which editor or IDE are you using? Did you 
automatically format or indent the code?

Otherwise, thanks.

At 07:45 PM 8/5/2004, yoavs@apache.org wrote:
>yoavs       2004/08/05 10:45:46
>
>   Modified:    src/java/org/apache/log4j Category.java Level.java
>                         Logger.java
>                tests    build.xml
>                tests/src/java/org/apache/log4j LoggerTestCase.java
>                         StressCategory.java
>   Log:
>   Added TRACE level: modified Level class to have TRACE as a native level,
>   between ALL and DEBUG.  Modified Category class to add trace(..) methods
>   like the existing debug(...) methods.  Modified LoggerTestCase and
>   StressCategory tests to do a bit of TRACE-specific testing.
>
>   Inspected but did not modify UGLI classes.  They don't include the FATAL
>   level, so I didn't want to inculde TRACE level without further discussion
>   which I will start on log4j-dev shortly.
>
>   Ensured everything compiles.  Ran unit tests: the relevant unit tests
>   pass.  Both the "regression" and "runAll" targets fail on a size-based
>   rolling policy test, which was also failing before I made my modifications
>   and anyways doesn't touch Level-related stuff, so I don't think it's
>   related.
>
>   There will probably be an additional coding pass in this area (if not
>   multiple) to further integrate TRACE, modify JavaDocs, modify tests, etc.
>
>   Revision  Changes    Path
>   1.85      +49 -10    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.84
>   retrieving revision 1.85
>   diff -u -r1.84 -r1.85
>   --- Category.java     28 May 2004 14:51:13 -0000      1.84
>   +++ Category.java     5 Aug 2004 17:45:45 -0000       1.85
>   @@ -46,7 +46,8 @@
>    /**
>     * <font color="#AA2222"><b>This class has been deprecated and 
> replaced by the
>     * {@link Logger}<em>subclass</em></b></font>. It will be
kept around to
>   - * preserve backward compatibility until mid 2003.
>   + * preserve backward compatibility until such time as the Log4j team 
> sees fit
>   + * to remove it.
>     *
>     * <p>
>     * <code>Logger</code> is a subclass of Category, i.e. it extends 
> Category. In
>   @@ -78,12 +79,13 @@
>     * </p>
>     *
>     * <p>
>   - * See the <a href="../../../../manual.html">short manual</a> for an
>   + * See the <a href="../../../../manual.html">Short Manual</a> for an
>     * introduction on this class.
>     * </p>
>     *
>     * @author Ceki G&uuml;lc&uuml;
>     * @author Anders Kristensen
>   + * @author Yoav Shapira
>     */
>    public class Category implements AppenderAttachable {
>      /**
>   @@ -96,11 +98,6 @@
>       * The hierarchy where categories are attached to by default.
>       */
>
>   -  //static
>   -  //public
>   -  //final Hierarchy defaultHierarchy = new Hierarchy(new
>   -  //                                    RootLogger(Level.DEBUG));
>   -
>      /**
>       * The name of this category.
>       */
>   @@ -252,6 +249,45 @@
>        }
>      }
>
>   +    /**
>   +     * Log a message object with the {@link Level#TRACE TRACE} level.
>   +     *
>   +     * @param message the message object to log.
>   +     * @see #debug(Object) for an explanation of the logic applied.
>   +     * @since 1.3
>   +     */
>   +    public void trace(Object message) {
>   +     if (repository.isDisabled(Level.TRACE_INT)) {
>   +         return;
>   +     }
>   +
>   +     if (Level.TRACE.isGreaterOrEqual(this.getEffectiveLevel())) {
>   +         forcedLog(FQCN, Level.TRACE, message, null);
>   +     }
>   +    }
>   +
>   +    /**
>   +     * Log a message object with the <code>TRACE</code> level 
> including the
>   +     * stack trace of the {@link Throwable}<code>t</code> passed as 
> parameter.
>   +     *
>   +     * <p>
>   +     * See {@link #debug(Object)} form for more detailed information.
>   +     * </p>
>   +     *
>   +     * @param message the message object to log.
>   +     * @param t the exception to log, including its stack trace.
>   +     */
>   +    public void trace(Object message, Throwable t) {
>   +     if (repository.isDisabled(Level.TRACE_INT)) {
>   +         return;
>   +     }
>   +
>   +     if (Level.TRACE.isGreaterOrEqual(this.getEffectiveLevel())) {
>   +         forcedLog(FQCN, Level.TRACE, message, t);
>   +     }
>   +    }
>   +
>   +
>      /**
>       * Log a message object with the {@link Level#DEBUG DEBUG} level.
>       *
>   @@ -1048,9 +1084,10 @@
>
>      /**
>       * Set the level of this Category. If you are passing any of
>   -   * <code>Level.DEBUG</code>, <code>Level.INFO</code>,
>   -   * <code>Level.WARN</code>, <code>Level.ERROR</code>,
>   -   * <code>Level.FATAL</code> as a parameter, you need to case them as

> Level.
>   +   * <code>Level.TRACE</code>, <code>Level.DEBUG</code>,
>   +   * <code>Level.INFO</code>, <code>Level.WARN</code>,
>   +   * <code>Level.ERROR</code>, or <code>Level.FATAL</code>
>   +   *  as a parameter, you need to case them as Level.
>       *
>       * <p>
>       * As in
>   @@ -1167,3 +1204,5 @@
>        }
>      }
>    }
>   +
>   +// End of class: Category.java
>
>
>
>   1.13      +292 -205  logging-log4j/src/java/org/apache/log4j/Level.java
>
>   Index: Level.java
>   ===================================================================
>   RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/Level.java,v
>   retrieving revision 1.12
>   retrieving revision 1.13
>   diff -u -r1.12 -r1.13
>   --- Level.java        19 May 2004 13:15:42 -0000      1.12
>   +++ Level.java        5 Aug 2004 17:45:45 -0000       1.13
>   @@ -23,235 +23,322 @@
>    /**
>       Defines the minimum set of levels recognized by the system, that is
>       <code>OFF</code>, <code>FATAL</code>, <code>ERROR</code>,
>   -   <code>WARN</code>, <code>INFO</code, <code>DEBUG</code>
and
>   -   <code>ALL</code>.
>   +   <code>WARN</code>, <code>INFO</code, <code>DEBUG</code>,
>   +   <code>TRACE</code>, and <code>ALL</code>.
>
>       <p>The <code>Level</code> class may be subclassed to define a
larger
>       level set.
>
>       @author Ceki G&uuml;lc&uuml;
>   -
>   +   @author Yoav Shapira
>     */
>    public class Level {
>   -  public static final int OFF_INT = Integer.MAX_VALUE;
>   -  public static final int FATAL_INT = 50000;
>   -  public static final int ERROR_INT = 40000;
>   -  public static final int WARN_INT = 30000;
>   -  public static final int INFO_INT = 20000;
>   -  public static final int DEBUG_INT = 10000;
>   -
>   -  //public final static int FINE_INT = DEBUG_INT;
>   -  public static final int ALL_INT = Integer.MIN_VALUE;
>   -
>   -  /**
>   -     The <code>OFF</code> has the highest possible rank and is
>   -     intended to turn off logging.  */
>   -  public static final Level OFF = new Level(OFF_INT, "OFF", 0);
>   -
>   -  /**
>   -     The <code>FATAL</code> level designates very severe error
>   -     events that will presumably lead the application to abort.
>   -   */
>   -  public static final Level FATAL = new Level(FATAL_INT, "FATAL", 0);
>   -
>   -  /**
>   -     The <code>ERROR</code> level designates error events that
>   -     might still allow the application to continue running.  */
>   -  public static final Level ERROR = new Level(ERROR_INT, "ERROR", 3);
>   -
>   -  /**
>   -     The <code>WARN</code> level designates potentially harmful 
> situations.
>   -  */
>   -  public static final Level WARN = new Level(WARN_INT, "WARN", 4);
>   -
>   -  /**
>   -     The <code>INFO</code> level designates informational messages
>   -     that highlight the progress of the application at coarse-grained
>   -     level.  */
>   -  public static final Level INFO = new Level(INFO_INT, "INFO", 6);
>   -
>   -  /**
>   -     The <code>DEBUG</code> Level designates fine-grained
>   -     informational events that are most useful to debug an
>   -     application.  */
>   -  public static final Level DEBUG = new Level(DEBUG_INT, "DEBUG", 7);
>   -
>   -  /**
>   -     The <code>ALL</code> has the lowest possible rank and is intended
to
>   -     turn on all logging.  */
>   -  public static final Level ALL = new Level(ALL_INT, "ALL", 7);
>   -
>   +    /**
>   +     * OFF level integer value.
>   +     */
>   +    public static final int OFF_INT = Integer.MAX_VALUE;
>   +
>   +    /**
>   +     * FATAL level integer value.
>   +     */
>   +    public static final int FATAL_INT = 50000;
>   +
>   +    /**
>   +     * ERROR level integer value.
>   +     */
>   +    public static final int ERROR_INT = 40000;
>   +
>   +    /**
>   +     * WARN level integer value.
>   +     */
>   +    public static final int WARN_INT = 30000;
>   +
>   +    /**
>   +     * INFO level integer value.
>   +     */
>   +    public static final int INFO_INT = 20000;
>   +
>   +    /**
>   +     * DEBUG level integer value.
>   +     */
>   +    public static final int DEBUG_INT = 10000;
>   +
>   +    /**
>   +     * TRACE level integer value.
>   +     */
>   +    public static final int TRACE_INT = 5000;
>   +
>   +    /**
>   +     * ALL level integer value.
>   +     */
>   +    public static final int ALL_INT = Integer.MIN_VALUE;
>
>   -  int level;
>   -  String levelStr;
>   -  int syslogEquivalent;
>   -
>   -  /**
>   -    Instantiate a level object.
>   -  */
>   -  protected Level(int level, String levelStr, int syslogEquivalent) {
>   -   this.level = level;
>   -   this.levelStr = levelStr;
>   -   this.syslogEquivalent = syslogEquivalent;
>   -  }
>   -
>   -  /**
>   -     Convert the string passed as argument to a level. If the
>   -     conversion fails, then this method returns {@link #DEBUG}.
>   -  */
>   -  public static Level toLevel(String sArg) {
>   -    return toLevel(sArg, Level.DEBUG);
>   -  }
>   -
>   -  /**
>   -    Convert an integer passed as argument to a level. If the
>   -    conversion fails, then this method returns {@link #DEBUG}.
>   -
>   -  */
>   -  public static Level toLevel(int val) {
>   -    return toLevel(val, Level.DEBUG);
>   -  }
>   -  /**
>   -   * Two priorities are equal if their level fields are equal.
>   -   * @since 1.2
>   -   */
>   -  public boolean equals(Object o) {
>   -    if (o instanceof Level) {
>   -      Level r = (Level) o;
>   -
>   -      return (this.level == r.level);
>   -    } else {
>   -      return false;
>   -    }
>   -  }
>   -
>   -  /**
>   -   * The hashCode        of a Level (i.e. Priority) is its level field.
>   -   */
>   -  public int hashCode() {
>   -    return level;
>   -  }
>   -
>   -  /**
>   -     Return the syslog equivalent of this priority as an integer.
>   -   */
>   -  public final int getSyslogEquivalent() {
>   -    return syslogEquivalent;
>   -  }
>   -
>   -  /**
>   -     Returns <code>true</code> if this level has a higher or equal
>   -     level than the level passed as argument, <code>false</code>
>   -     otherwise.
>   -
>   -     <p>You should think twice before overriding the default
>   -     implementation of <code>isGreaterOrEqual</code> method.
>   -
>   -  */
>   -  public boolean isGreaterOrEqual(Level r) {
>   -    return level >= r.level;
>   -  }
>   -
>   -  /**
>   -  Return all possible priorities as an array of Level objects in
>   -  descending order.
>   -
>   -  @deprecated This method will be removed with no replacement.
>   -*/
>   -  public static Level[] getAllPossiblePriorities() {
>   -    return new Level[] {
>   -     Level.FATAL, Level.ERROR, Level.WARN, Level.INFO, Level.DEBUG
>   - };
>   -}
>   -
>   -
>   -  /**
>   -  Returns the string representation of this priority.
>   -  */
>   -  public final String toString() {
>   -    return levelStr;
>   -  }
>   -
>   -  /**
>   -    Returns the integer representation of this level.
>   -  */
>   -  public final int toInt() {
>   -    return level;
>   -  }
>   -
>   -  /**
>   -    Convert an integer passed as argument to a level. If the
>   -    conversion fails, then this method returns the specified default.
>   -  */
>   -  public static Level toLevel(int val, Level defaultLevel) {
>   -    switch (val) {
>   -    case ALL_INT:
>   -      return ALL;
>   -
>   -    case DEBUG_INT:
>   -      return Level.DEBUG;
>   -
>   -    case INFO_INT:
>   -      return Level.INFO;
>   -
>   -    case WARN_INT:
>   -      return Level.WARN;
>   -
>   -    case ERROR_INT:
>   -      return Level.ERROR;
>   -
>   -    case FATAL_INT:
>   -      return Level.FATAL;
>   -
>   -    case OFF_INT:
>   -      return OFF;
>   -
>   -    default:
>   -      return defaultLevel;
>   +    /**
>   +     * The <code>OFF</code> has the highest possible rank and is
>   +     * intended to turn off logging.
>   +     */
>   +    public static final Level OFF = new Level(OFF_INT, "OFF", 0);
>   +
>   +    /**
>   +     * The <code>FATAL</code> level designates very severe error
>   +     * events that will presumably lead the application to abort.
>   +     */
>   +    public static final Level FATAL = new Level(FATAL_INT, "FATAL", 0);
>   +
>   +    /**
>   +     * The <code>ERROR</code> level designates error events that
>   +     * might still allow the application to continue running.
>   +     */
>   +    public static final Level ERROR = new Level(ERROR_INT, "ERROR", 3);
>   +
>   +    /**
>   +     * The <code>WARN</code> level designates potentially harmful 
> situations.
>   +     */
>   +    public static final Level WARN = new Level(WARN_INT, "WARN", 4);
>   +
>   +    /**
>   +     * The <code>INFO</code> level designates informational messages
>   +     * that highlight the progress of the application at coarse-grained
>   +     * level.
>   +     */
>   +    public static final Level INFO = new Level(INFO_INT, "INFO", 6);
>   +
>   +    /**
>   +     * The <code>DEBUG</code> Level designates fine-grained
>   +     * informational events that are most useful to debug an
>   +     * application.
>   +     */
>   +    public static final Level DEBUG = new Level(DEBUG_INT, "DEBUG", 7);
>   +
>   +    /**
>   +     * The <code>TRACE</code> Level designates finer-grained
>   +     * informational events than the <code>DEBUG</code level.
>   +     */
>   +    public static final Level TRACE = new Level(TRACE_INT, "TRACE", 7);
>   +
>   +    /**
>   +     * The <code>ALL</code> has the lowest possible rank and is 
> intended to
>   +     * turn on all logging.
>   +     */
>   +    public static final Level ALL = new Level(ALL_INT, "ALL", 7);
>   +
>   +    /**
>   +     * The integer value of this Level instance.
>   +     */
>   +    int level;
>   +
>   +    /**
>   +     * The label of this Level instance.
>   +     */
>   +    String levelStr;
>   +
>   +    /**
>   +     * The UNIX SysLog equivalent value of this Level instance.
>   +     */
>   +    int syslogEquivalent;
>   +
>   +    /**
>   +     * Instantiate a level object.
>   +     *
>   +     * @param level The integer level value
>   +     * @param levelStr The level name
>   +     * @param syslogEquivalent The UNIX SystLog level equivalent
>   +     */
>   +    protected Level(int level, String levelStr, int syslogEquivalent) {
>   +     this.level = level;
>   +     this.levelStr = levelStr;
>   +     this.syslogEquivalent = syslogEquivalent;
>        }
>   -  }
>   -
>   -  /**
>   -     Convert the string passed as argument to a level. If the
>   -     conversion fails, then this method returns the value of
>   -     <code>defaultLevel</code>.
>   -  */
>   -  public static Level toLevel(String sArg, Level defaultLevel) {
>   -    if (sArg == null) {
>   -      return defaultLevel;
>   +
>   +    /**
>   +     * Convert the string passed as argument to a level. If the
>   +     * conversion fails, then this method returns {@link #DEBUG}.
>   +     *
>   +     * @param sArg The level name
>   +     * @return The matching Level object
>   +     */
>   +    public static Level toLevel(String sArg) {
>   +     return toLevel(sArg, Level.DEBUG);
>        }
>
>   -    String s = sArg.toUpperCase();
>   +    /**
>   +     * Convert an integer passed as argument to a level. If the
>   +     * conversion fails, then this method returns {@link #DEBUG}.
>   +     *
>   +     * @param val The level integer value
>   +     * @return The matching Level object
>   +     */
>   +    public static Level toLevel(int val) {
>   +     return toLevel(val, Level.DEBUG);
>   +    }
>
>   -    if (s.equals("ALL")) {
>   -      return Level.ALL;
>   +    /**
>   +     * Two Levels (formerly Priorities) are equal if their level
>   +     * integer value fields are equal.  If the argument is not
>   +     * a Level, this method returns False.
>   +     *
>   +     * @param o The other Level
>   +     * @return boolean True if equals
>   +     * @since 1.2
>   +     */
>   +    public boolean equals(Object o) {
>   +     if (o instanceof Level) {
>   +         Level r = (Level) o;
>   +
>   +         return (this.level == r.level);
>   +     } else {
>   +         return false;
>   +     }
>        }
>
>   -    if (s.equals("DEBUG")) {
>   -      return Level.DEBUG;
>   +    /**
>   +     * The hashCode of a Level (i.e. Priority) is its level field.
>   +     *
>   +     * @return The integer level value
>   +     */
>   +    public int hashCode() {
>   +     return level;
>        }
>
>   -    //if(s.equals("FINE")) return Level.FINE;
>   -    if (s.equals("INFO")) {
>   -      return Level.INFO;
>   +    /**
>   +     * Return the syslog equivalent of this priority as an integer.
>   +     *
>   +     * @return The UNIX SysLog equivalent
>   +     */
>   +    public final int getSyslogEquivalent() {
>   +     return syslogEquivalent;
>        }
>
>   -    if (s.equals("WARN")) {
>   -      return Level.WARN;
>   +    /**
>   +     *  Returns <code>true</code> if this level has a higher or equal
>   +     *  level than the level passed as argument, <code>false</code>
>   +     *  otherwise.
>   +     *
>   +     *  <p>You should think twice before overriding the default
>   +     *  implementation of <code>isGreaterOrEqual</code> method.</p>
>   +     */
>   +    public boolean isGreaterOrEqual(Level r) {
>   +     return level >= r.level;
>        }
>
>   -    if (s.equals("ERROR")) {
>   -      return Level.ERROR;
>   +    /**
>   +     * Return all possible priorities as an array of Level objects in
>   +     * descending order.
>   +     *
>   +     * @return Level[] All the Levels
>   +     * @deprecated This method will be removed with no replacement.
>   +     */
>   +    public static Level[] getAllPossiblePriorities() {
>   +     return new Level[] {
>   +         Level.FATAL, Level.ERROR, Level.WARN, Level.INFO, 
> Level.DEBUG, Level.TRACE
>   +     };
>        }
>
>   -    if (s.equals("FATAL")) {
>   -      return Level.FATAL;
>   +    /**
>   +     * Returns the string representation of this Level.
>   +     *
>   +     * @return String The Level name
>   +     */
>   +    public final String toString() {
>   +     return levelStr;
>        }
>
>   -    if (s.equals("OFF")) {
>   -      return Level.OFF;
>   +    /**
>   +     * Returns the integer representation of this level.
>   +     */
>   +    public final int toInt() {
>   +     return level;
>        }
>   +
>   +    /**
>   +     * Convert an integer passed as argument to a level. If the
>   +     * conversion fails, then this method returns the specified default.
>   +     *
>   +     * @param val The integer value
>   +     * @param defaultLevel The Level to return if no match is found
>   +     * @return The matching Level
>   +     */
>   +    public static Level toLevel(int val, Level defaultLevel) {
>   +     switch (val) {
>   +     case ALL_INT:
>   +         return ALL;
>   +
>   +     case TRACE_INT:
>   +         return TRACE;
>   +
>   +     case DEBUG_INT:
>   +         return DEBUG;
>   +
>   +     case INFO_INT:
>   +         return INFO;
>   +
>   +     case WARN_INT:
>   +         return WARN;
>   +
>   +     case ERROR_INT:
>   +         return ERROR;
>   +
>   +     case FATAL_INT:
>   +         return FATAL;
>   +
>   +     case OFF_INT:
>   +         return OFF;
>   +
>   +     default:
>   +         return defaultLevel;
>   +     }
>   +    }
>   +
>   +    /**
>   +     * Convert the string passed as argument to a level. If the
>   +     * conversion fails, then this method returns the
>   +     * <code>defaultLevel</code>.
>   +     *
>   +     * @param sArg The Level name
>   +     * @param defaultLevel Level to return if no match is found
>   +     * @return The matching Level
>   +     */
>   +    public static Level toLevel(String sArg, Level defaultLevel) {
>   +     if (sArg == null) {
>   +         return defaultLevel;
>   +     }
>   +
>   +     String s = sArg.toUpperCase();
>   +
>   +     if (s.equals("ALL")) {
>   +         return ALL;
>   +     }
>   +
>   +     if (s.equals("TRACE")) {
>   +         return TRACE;
>   +     }
>   +
>   +     if (s.equals("DEBUG")) {
>   +         return DEBUG;
>   +     }
>   +
>   +     if (s.equals("INFO")) {
>   +         return INFO;
>   +     }
>   +
>   +     if (s.equals("WARN")) {
>   +         return WARN;
>   +     }
>   +
>   +     if (s.equals("ERROR")) {
>   +         return ERROR;
>   +     }
>   +
>   +     if (s.equals("FATAL")) {
>   +         return FATAL;
>   +     }
>   +
>   +     if (s.equals("OFF")) {
>   +         return OFF;
>   +     }
>
>   -    return defaultLevel;
>   -  }
>   +     return defaultLevel;
>   +    }
>    }
>   +
>   +// End of class: Level.java
>
>
>
>   1.20      +12 -51    logging-log4j/src/java/org/apache/log4j/Logger.java
>
>   Index: Logger.java
>   ===================================================================
>   RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/Logger.java,v
>   retrieving revision 1.19
>   retrieving revision 1.20
>   diff -u -r1.19 -r1.20
>   --- Logger.java       27 Feb 2004 16:47:28 -0000      1.19
>   +++ Logger.java       5 Aug 2004 17:45:45 -0000       1.20
>   @@ -25,58 +25,17 @@
>
>      @since log4j 1.2
>
>   -  @author Ceki G&uuml;lc&uuml; */
>   +  @author Ceki G&uuml;lc&uuml;
>   +*/
>    public class Logger extends Category {
>   -  protected Logger(String name) {
>   -    super(name);
>   -  }
>   -
>   -  /**
>   -    Log a message object with the {@link Level#FINE FINE} level which
>   -    is just an alias for the {@link Level#DEBUG DEBUG} level.
>   -
>   -    <p>This method first checks if this category is <code>DEBUG</code>
>   -    enabled by comparing the level of this category with the {@link
>   -    Level#DEBUG DEBUG} level. If this category is
>   -    <code>DEBUG</code> enabled, then it converts the message object
>   -    (passed as parameter) to a string by invoking the appropriate
>   -    {@link org.apache.log4j.or.ObjectRenderer}. It then proceeds to 
> call all the
>   -    registered appenders in this category and also higher in the
>   -    hierarchy depending on the value of the additivity flag.
>   -
>   -    <p><b>WARNING</b> Note that passing a {@link Throwable} to this
>   -    method will print the name of the <code>Throwable</code> but no
>   -    stack trace. To print a stack trace use the {@link #debug(Object,
>   -    Throwable)} form instead.
>   -
>   -    @param message the message object to log. */
>   -
>   -  //public
>   -  //void fine(Object message) {
>   -  //  if(repository.isDisabled(Level.DEBUG_INT))
>   -  //    return;
>   -  //  if(Level.DEBUG.isGreaterOrEqual(this.getChainedLevel())) {
>   -  //    forcedLog(FQCN, Level.DEBUG, message, null);
>   -  //  }
>   -  //}
>   -
>   -  /**
>   -   Log a message object with the <code>FINE</code> level including
>   -   the stack trace of the {@link Throwable} <code>t</code> passed as
>   -   parameter.
>   -
>   -   <p>See {@link #fine(Object)} form for more detailed information.
>   -
>   -   @param message the message object to log.
>   -   @param t the exception to log, including its stack trace.  */
>   -
>   -  //public
>   -  //void fine(Object message, Throwable t) {
>   -  //  if(repository.isDisabled(Level.DEBUG_INT))
>   -  //    return;
>   -  //  if(Level.DEBUG.isGreaterOrEqual(this.getChainedLevel()))
>   -  //    forcedLog(FQCN, Level.FINE, message, t);
>   -  //}
>   +    /**
>   +     * Constructor.
>   +     *
>   +     * @param name The logger instance name
>   +     */
>   +    protected Logger(String name) {
>   +     super(name);
>   +    }
>
>      /**
>         Retrieve a logger by name.
>   @@ -117,3 +76,5 @@
>        return LogManager.getLogger(name, factory);
>      }
>    }
>   +
>   +// End of class: Logger.java
>
>
>
>   1.61      +2 -2      logging-log4j/tests/build.xml
>
>   Index: build.xml
>   ===================================================================
>   RCS file: /home/cvs/logging-log4j/tests/build.xml,v
>   retrieving revision 1.60
>   retrieving revision 1.61
>   diff -u -r1.60 -r1.61
>   --- build.xml 6 Jun 2004 11:34:13 -0000       1.60
>   +++ build.xml 5 Aug 2004 17:45:45 -0000       1.61
>   @@ -81,9 +81,9 @@
>      <!-- 
> ================================================================= -->
>      <target name="build" depends="parentBuild, prepare">
>        <javac srcdir="${tests.source.home}"
>   -        destdir="./classes" excludes="${stem}/chainsaw/receivers/*.java"
>   +        destdir="./classes" 
> excludes="${stem}/chainsaw/receivers/*.java,**/PassByJNDI.java"
>            deprecation="${deprecation}"
>   -        debug="on">
>   +        debug="on">
>          <classpath refid="tests.classpath"/>
>        </javac>
>      </target>
>
>
>
>   1.8       +15 
> -14    logging-log4j/tests/src/java/org/apache/log4j/LoggerTestCase.java
>
>   Index: LoggerTestCase.java
>   ===================================================================
>   RCS file: 
> /home/cvs/logging-log4j/tests/src/java/org/apache/log4j/LoggerTestCase.java,v
>   retrieving revision 1.7
>   retrieving revision 1.8
>   diff -u -r1.7 -r1.8
>   --- LoggerTestCase.java       15 May 2004 18:22:57 -0000      1.7
>   +++ LoggerTestCase.java       5 Aug 2004 17:45:45 -0000       1.8
>   @@ -205,8 +205,12 @@
>        h.setThreshold((Level) Level.INFO);
>        assertEquals(caRoot.counter, 0);
>
>   +    root.trace(MSG);
>   +    assertEquals(caRoot.counter, 0);
>   +
>        root.debug(MSG);
>        assertEquals(caRoot.counter, 0);
>   +
>        root.info(MSG);
>        assertEquals(caRoot.counter, 1);
>        root.log(Level.WARN, MSG);
>   @@ -216,8 +220,13 @@
>
>        //h.disableInfo();
>        h.setThreshold((Level) Level.WARN);
>   +
>   +    root.trace(MSG);
>   +    assertEquals(caRoot.counter, 3);
>   +
>        root.debug(MSG);
>        assertEquals(caRoot.counter, 3);
>   +
>        root.info(MSG);
>        assertEquals(caRoot.counter, 3);
>        root.log(Level.WARN, MSG);
>   @@ -229,30 +238,20 @@
>
>        //h.disableAll();
>        h.setThreshold(Level.OFF);
>   -    root.debug(MSG);
>   -    assertEquals(caRoot.counter, 6);
>   -    root.info(MSG);
>   -    assertEquals(caRoot.counter, 6);
>   -    root.log(Level.WARN, MSG);
>   -    assertEquals(caRoot.counter, 6);
>   -    root.error(MSG);
>   -    assertEquals(caRoot.counter, 6);
>   -    root.log(Level.FATAL, MSG);
>   -    assertEquals(caRoot.counter, 6);
>   -    root.log(Level.FATAL, MSG);
>   +
>   +    root.trace(MSG);
>        assertEquals(caRoot.counter, 6);
>
>   -    //h.disable(Level.FATAL);
>   -    h.setThreshold(Level.OFF);
>        root.debug(MSG);
>        assertEquals(caRoot.counter, 6);
>   +
>        root.info(MSG);
>        assertEquals(caRoot.counter, 6);
>        root.log(Level.WARN, MSG);
>        assertEquals(caRoot.counter, 6);
>        root.error(MSG);
>        assertEquals(caRoot.counter, 6);
>   -    root.log(Level.ERROR, MSG);
>   +    root.log(Level.FATAL, MSG);
>        assertEquals(caRoot.counter, 6);
>        root.log(Level.FATAL, MSG);
>        assertEquals(caRoot.counter, 6);
>   @@ -381,3 +380,5 @@
>        }
>      }
>    }
>   +
>   +// End of class: LoggerTestCase.java
>
>
>
>   1.3       +4 
> -11     logging-log4j/tests/src/java/org/apache/log4j/StressCategory.java
>
>   Index: StressCategory.java
>   ===================================================================
>   RCS file: 
> /home/cvs/logging-log4j/tests/src/java/org/apache/log4j/StressCategory.java,v
>   retrieving revision 1.2
>   retrieving revision 1.3
>   diff -u -r1.2 -r1.3
>   --- StressCategory.java       19 May 2004 14:36:22 -0000      1.2
>   +++ StressCategory.java       5 Aug 2004 17:45:45 -0000       1.3
>   @@ -19,7 +19,8 @@
>
>    class StressCategory {
>
>   -  static Level[] level = new Level[] {Level.DEBUG,
>   +  static Level[] level = new Level[] {Level.TRACE,
>   +                                   Level.DEBUG,
>                                       Level.INFO,
>                                       Level.WARN,
>                                       Level.ERROR,
>   @@ -169,16 +170,6 @@
>        }
>      }
>
>   -  //  static
>   -  //void provisionNodesDump() {
>   -  //for (Enumeration e = CategoryFactory.ht.keys(); 
> e.hasMoreElements() ;) {
>   -  //  CategoryKey key = (CategoryKey) e.nextElement();
>   -  //  Object c = CategoryFactory.ht.get(key);
>   -  //  if(c instanceof  ProvisionNode)
>   -  //((ProvisionNode) c).dump(key.name);
>   -  //}
>   -  //}
>   -
>      static
>      boolean checkCorrectness(int i) {
>        CT localCT = ct[i];
>   @@ -240,3 +231,5 @@
>        }
>      }
>    }
>   +
>   +// End of class: StressCategory.java
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-dev-help@logging.apache.org

-- 
Ceki Gülcü

      For log4j documentation consider "The complete log4j manual"
      ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp  



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


Mime
View raw message