You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by ce...@apache.org on 2004/09/17 12:15:32 UTC

cvs commit: logging-log4j/src/java/org/apache/log4j/pattern ThreadPatternConverter.java ThrowableInformationPatternConverter.java

ceki        2004/09/17 03:15:32

  Modified:    tests/src/java/org/apache/log4j/pattern
                        Num343PatternConverter.java
               src/java/org/apache/log4j/pattern
                        ThreadPatternConverter.java
                        ThrowableInformationPatternConverter.java
  Log:
  Added missing getStyleClass methods in various files
  
  Revision  Changes    Path
  1.4       +6 -0      logging-log4j/tests/src/java/org/apache/log4j/pattern/Num343PatternConverter.java
  
  Index: Num343PatternConverter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/src/java/org/apache/log4j/pattern/Num343PatternConverter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Num343PatternConverter.java	28 May 2004 16:28:57 -0000	1.3
  +++ Num343PatternConverter.java	17 Sep 2004 10:15:31 -0000	1.4
  @@ -21,6 +21,8 @@
   
   public class Num343PatternConverter extends PatternConverter {
     static private final String NAME = "Num34";
  +  static private final String STYLE_CLASS = NAME.toLowerCase();
  +  
     StringBuffer buf;
   
     public Num343PatternConverter() {
  @@ -37,5 +39,9 @@
     
     public String getName() {
       return NAME;
  +  }
  +  
  +  public String getStyleClass(LoggingEvent e) {
  +    return STYLE_CLASS;
     }
   }
  
  
  
  1.5       +4 -0      logging-log4j/src/java/org/apache/log4j/pattern/ThreadPatternConverter.java
  
  Index: ThreadPatternConverter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/pattern/ThreadPatternConverter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ThreadPatternConverter.java	28 May 2004 16:28:56 -0000	1.4
  +++ ThreadPatternConverter.java	17 Sep 2004 10:15:32 -0000	1.5
  @@ -46,5 +46,9 @@
     {
         return "Thread";
     }
  +  
  +  public String getStyleClass(LoggingEvent e) {
  +    return "thread";
  +  }
   
   }
  
  
  
  1.4       +37 -38    logging-log4j/src/java/org/apache/log4j/pattern/ThrowableInformationPatternConverter.java
  
  Index: ThrowableInformationPatternConverter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/pattern/ThrowableInformationPatternConverter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ThrowableInformationPatternConverter.java	28 May 2004 16:28:56 -0000	1.3
  +++ ThrowableInformationPatternConverter.java	17 Sep 2004 10:15:32 -0000	1.4
  @@ -1,18 +1,19 @@
   /*
    * Copyright 1999,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
  +
   package org.apache.log4j.pattern;
   
   import org.apache.log4j.spi.LoggingEvent;
  @@ -28,47 +29,45 @@
    *
    */
   public class ThrowableInformationPatternConverter extends PatternConverter {
  +  /* (non-Javadoc)
  +   * @see org.apache.log4j.pattern.PatternConverter#convert(org.apache.log4j.spi.LoggingEvent)
  +   */
  +  protected StringBuffer convert(LoggingEvent event) {
  +    StringBuffer buf = new StringBuffer(32);
   
  -    /* (non-Javadoc)
  -     * @see org.apache.log4j.pattern.PatternConverter#convert(org.apache.log4j.spi.LoggingEvent)
  -     */
  -    protected StringBuffer convert(LoggingEvent event) {
  -
  -        StringBuffer buf = new StringBuffer(32);
  -
  -        ThrowableInformation information = event.getThrowableInformation();
  -
  -        if (information == null) {
  +    ThrowableInformation information = event.getThrowableInformation();
   
  -            return buf;
  -        }
  -
  -        String[] stringRep = information.getThrowableStrRep();
  -
  -        int length = 0;
  -
  -        if (getOption() == null) {
  -            length = stringRep.length;
  -        } else if (getOption().equals("full")) {
  -            length = stringRep.length;
  -        } else if (getOption().equals("short")) {
  -            length = 1;
  -        } else {
  -            length = stringRep.length;
  -        }
  +    if (information == null) {
  +      return buf;
  +    }
   
  -        for (int i = 0; i < length; i++) {
  +    String[] stringRep = information.getThrowableStrRep();
   
  -            String string = stringRep[i];
  -            buf.append(string).append("\n");
  -        }
  +    int length = 0;
   
  -        return buf;
  +    if (getOption() == null) {
  +      length = stringRep.length;
  +    } else if (getOption().equals("full")) {
  +      length = stringRep.length;
  +    } else if (getOption().equals("short")) {
  +      length = 1;
  +    } else {
  +      length = stringRep.length;
       }
  -    
  -    public String getName()
  -    {
  -        return "Throwable";
  +
  +    for (int i = 0; i < length; i++) {
  +      String string = stringRep[i];
  +      buf.append(string).append("\n");
       }
   
  +    return buf;
  +  }
  +
  +  public String getName() {
  +    return "Throwable";
  +  }
  +
  +  public String getStyleClass(LoggingEvent e) {
  +    return "throwable";
  +  }
   }
  
  
  

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