logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject cvs commit: logging-log4j/src/java/org/apache/log4j/spi LoggingEvent.java
Date Fri, 14 May 2004 06:20:13 GMT
sdeboy      2004/05/13 23:20:13

  Modified:    src/java/org/apache/log4j/spi LoggingEvent.java
  Log:
  Renamed 'loggerName' variable back to categoryName in order to try to maintain object serialization
compatibility with log4j 1.2.8
  
  Revision  Changes    Path
  1.61      +12 -10    logging-log4j/src/java/org/apache/log4j/spi/LoggingEvent.java
  
  Index: LoggingEvent.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/spi/LoggingEvent.java,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- LoggingEvent.java	12 May 2004 19:39:14 -0000	1.60
  +++ LoggingEvent.java	14 May 2004 06:20:13 -0000	1.61
  @@ -118,7 +118,9 @@
      *             Please do not access it directly. Use the {@link
      *             #getLoggerName} method instead.
      */
  -  private String loggerName;
  +  //the 'logger name' variable name ("categoryName") must remain the same as prior versions
in order
  +  //to maintain serialization compatibility with log4j 1.2.8
  +  private String categoryName;
   
     /**
      * Level of logging event. Level cannot be serializable because it is a
  @@ -224,7 +226,7 @@
     public LoggingEvent(String fqnOfLoggerClass, Logger logger, Level level, Object message,
Throwable throwable) {
       this.fqnOfLoggerClass = fqnOfLoggerClass;
       this.logger = logger;
  -    this.loggerName = logger.getName();
  +    this.categoryName = logger.getName();
       this.level = level;
       this.message = message;
   
  @@ -257,7 +259,7 @@
       Throwable throwable) {
       this.fqnOfLoggerClass = fqnOfCategoryClass;
       this.logger = logger;
  -    this.loggerName = logger.getName();
  +    this.categoryName = logger.getName();
       this.level = level;
       this.message = message;
   
  @@ -416,13 +418,13 @@
         throw new IllegalStateException("logger has been already set to [" + this.logger.getName()
+ "].");
       }
   
  -    if (this.loggerName != null) {
  -      throw new IllegalStateException("loggerName has been already set to [" + this.loggerName
+ "], logger "
  +    if (this.categoryName != null) {
  +      throw new IllegalStateException("loggerName has been already set to [" + this.categoryName
+ "], logger "
           + logger.getName() + "] is invalid");
       }
   
       this.logger = logger;
  -    this.loggerName = logger.getName();
  +    this.categoryName = logger.getName();
     }
   
   
  @@ -430,7 +432,7 @@
      * Return the name of the logger.
      */
     public String getLoggerName() {
  -    return loggerName;
  +    return categoryName;
     }
   
   
  @@ -443,10 +445,10 @@
      */
     public void setLoggerName(String loggerName)
            throws IllegalStateException {
  -    if (this.loggerName != null) {
  -      throw new IllegalStateException("loggerName has been already set to [" + this.loggerName
+ "].");
  +    if (this.categoryName != null) {
  +      throw new IllegalStateException("loggerName has been already set to [" + this.categoryName
+ "].");
       } else {
  -      this.loggerName = loggerName;
  +      this.categoryName = loggerName;
       }
     }
   
  
  
  

---------------------------------------------------------------------
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