logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject cvs commit: logging-log4j/tests/src/java/org/apache/log4j/pattern Num343PatternConverter.java
Date Fri, 28 May 2004 16:28:57 GMT
ceki        2004/05/28 09:28:57

  Modified:    src/java/org/apache/log4j/pattern
                        FileLocationPatternConverter.java
                        MethodLocationPatternConverter.java
                        RelativeTimePatternConverter.java
                        NDCPatternConverter.java
                        ClassNamePatternConverter.java
                        ThrowableInformationPatternConverter.java
                        DatePatternConverter.java
                        LineLocationPatternConverter.java
                        LineSeparatorPatternConverter.java
                        MessagePatternConverter.java PatternConverter.java
                        FullLocationPatternConverter.java
                        LoggerPatternConverter.java
                        LiteralPatternConverter.java
                        PropertiesPatternConverter.java
                        ThreadPatternConverter.java
                        LevelPatternConverter.java
               examples/src/pattern CountingPatternConverter.java
               tests/src/java/org/apache/log4j/pattern
                        Num343PatternConverter.java
  Log:
  Added name() method to PatternConverter.
  
  Revision  Changes    Path
  1.5       +6 -0      logging-log4j/src/java/org/apache/log4j/pattern/FileLocationPatternConverter.java
  
  Index: FileLocationPatternConverter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/pattern/FileLocationPatternConverter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FileLocationPatternConverter.java	10 May 2004 22:24:22 -0000	1.4
  +++ FileLocationPatternConverter.java	28 May 2004 16:28:56 -0000	1.5
  @@ -46,4 +46,10 @@
   
       return buf;
     }
  +  
  +  public String getName()
  +  {
  +      return "File Location";
  +  }
  +  
   }
  
  
  
  1.5       +6 -0      logging-log4j/src/java/org/apache/log4j/pattern/MethodLocationPatternConverter.java
  
  Index: MethodLocationPatternConverter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/pattern/MethodLocationPatternConverter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MethodLocationPatternConverter.java	10 May 2004 22:24:22 -0000	1.4
  +++ MethodLocationPatternConverter.java	28 May 2004 16:28:56 -0000	1.5
  @@ -46,4 +46,10 @@
   
       return buf;
     }
  +  
  +  public String getName()
  +  {
  +      return "Method";
  +  }
  +  
   }
  
  
  
  1.5       +6 -0      logging-log4j/src/java/org/apache/log4j/pattern/RelativeTimePatternConverter.java
  
  Index: RelativeTimePatternConverter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/pattern/RelativeTimePatternConverter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RelativeTimePatternConverter.java	9 May 2004 18:37:56 -0000	1.4
  +++ RelativeTimePatternConverter.java	28 May 2004 16:28:56 -0000	1.5
  @@ -40,4 +40,10 @@
       buf.append(Long.toString(event.getTimeStamp() - LoggingEvent.getStartTime()));
       return buf;
     }
  +  
  +  public String getName()
  +  {
  +      return "Time";
  +  }
  +  
   }
  
  
  
  1.4       +6 -0      logging-log4j/src/java/org/apache/log4j/pattern/NDCPatternConverter.java
  
  Index: NDCPatternConverter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/pattern/NDCPatternConverter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- NDCPatternConverter.java	27 Feb 2004 16:47:32 -0000	1.3
  +++ NDCPatternConverter.java	28 May 2004 16:28:56 -0000	1.4
  @@ -40,4 +40,10 @@
   
       return buf;
     }
  +  
  +  public String getName()
  +  {
  +      return "NDC";
  +  }
  +  
   }
  
  
  
  1.7       +5 -0      logging-log4j/src/java/org/apache/log4j/pattern/ClassNamePatternConverter.java
  
  Index: ClassNamePatternConverter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/pattern/ClassNamePatternConverter.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ClassNamePatternConverter.java	12 May 2004 15:39:03 -0000	1.6
  +++ ClassNamePatternConverter.java	28 May 2004 16:28:56 -0000	1.7
  @@ -35,4 +35,9 @@
   	   return event.getLocationInformation()!=null?event.getLocationInformation().getClassName():"";
   	 }
     
  +  public String getName()
  +  {
  +      return "Class Name";
  +  }
  +  
   }
  
  
  
  1.3       +7 -1      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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ThrowableInformationPatternConverter.java	27 Feb 2004 16:47:32 -0000	1.2
  +++ ThrowableInformationPatternConverter.java	28 May 2004 16:28:56 -0000	1.3
  @@ -12,7 +12,8 @@
    * 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;
  + */
  +package org.apache.log4j.pattern;
   
   import org.apache.log4j.spi.LoggingEvent;
   import org.apache.log4j.spi.ThrowableInformation;
  @@ -63,6 +64,11 @@
           }
   
           return buf;
  +    }
  +    
  +    public String getName()
  +    {
  +        return "Throwable";
       }
   
   }
  
  
  
  1.5       +6 -0      logging-log4j/src/java/org/apache/log4j/pattern/DatePatternConverter.java
  
  Index: DatePatternConverter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/pattern/DatePatternConverter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DatePatternConverter.java	9 May 2004 18:37:56 -0000	1.4
  +++ DatePatternConverter.java	28 May 2004 16:28:56 -0000	1.5
  @@ -76,4 +76,10 @@
   
       return buf;
     }
  +
  +  public String getName()
  +  {
  +      return "Date";
  +  }
  +  
   }
  
  
  
  1.5       +6 -0      logging-log4j/src/java/org/apache/log4j/pattern/LineLocationPatternConverter.java
  
  Index: LineLocationPatternConverter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/pattern/LineLocationPatternConverter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LineLocationPatternConverter.java	10 May 2004 22:24:22 -0000	1.4
  +++ LineLocationPatternConverter.java	28 May 2004 16:28:56 -0000	1.5
  @@ -46,4 +46,10 @@
   
       return buf;
     }
  +  
  +  public String getName()
  +  {
  +      return "Line";
  +  }
  +  
   }
  
  
  
  1.3       +6 -0      logging-log4j/src/java/org/apache/log4j/pattern/LineSeparatorPatternConverter.java
  
  Index: LineSeparatorPatternConverter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/pattern/LineSeparatorPatternConverter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LineSeparatorPatternConverter.java	27 Feb 2004 16:47:32 -0000	1.2
  +++ LineSeparatorPatternConverter.java	28 May 2004 16:28:56 -0000	1.3
  @@ -38,4 +38,10 @@
     public StringBuffer convert(LoggingEvent event) {
       return buf;
     }
  +  
  +  public String getName()
  +  {
  +      return "Line Sep";
  +  }
  +  
   }
  
  
  
  1.4       +6 -0      logging-log4j/src/java/org/apache/log4j/pattern/MessagePatternConverter.java
  
  Index: MessagePatternConverter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/pattern/MessagePatternConverter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MessagePatternConverter.java	27 Feb 2004 16:47:32 -0000	1.3
  +++ MessagePatternConverter.java	28 May 2004 16:28:56 -0000	1.4
  @@ -50,4 +50,10 @@
   
       return buf;
     }
  +  
  +  public String getName()
  +  {
  +      return "Message";
  +  }
  +  
   }
  
  
  
  1.6       +9 -0      logging-log4j/src/java/org/apache/log4j/pattern/PatternConverter.java
  
  Index: PatternConverter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/pattern/PatternConverter.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PatternConverter.java	16 Apr 2004 21:22:20 -0000	1.5
  +++ PatternConverter.java	28 May 2004 16:28:56 -0000	1.6
  @@ -128,4 +128,13 @@
     public void setOption(String string) {
       option = string;
     }
  +  
  +  /**
  +   * This method returns the name of the conversion pattern.
  +   * 
  +   * The name can be useful to certain Layouts such as HTMLLayout.
  +   * 
  +   * @return	the name of the conversion pattern
  +   */
  +  public abstract String getName();
   }
  
  
  
  1.5       +6 -0      logging-log4j/src/java/org/apache/log4j/pattern/FullLocationPatternConverter.java
  
  Index: FullLocationPatternConverter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/pattern/FullLocationPatternConverter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FullLocationPatternConverter.java	10 May 2004 22:24:22 -0000	1.4
  +++ FullLocationPatternConverter.java	28 May 2004 16:28:56 -0000	1.5
  @@ -46,4 +46,10 @@
   
       return buf;
     }
  +  
  +  public String getName()
  +  {
  +      return "Full Location";
  +  }
  +  
   }
  
  
  
  1.4       +6 -0      logging-log4j/src/java/org/apache/log4j/pattern/LoggerPatternConverter.java
  
  Index: LoggerPatternConverter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/pattern/LoggerPatternConverter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LoggerPatternConverter.java	27 Feb 2004 16:47:32 -0000	1.3
  +++ LoggerPatternConverter.java	28 May 2004 16:28:56 -0000	1.4
  @@ -35,4 +35,10 @@
     String getFullyQualifiedName(LoggingEvent event) {
   	  return event.getLoggerName();
     } 
  +  
  +  public String getName()
  +  {
  +      return "Logger";
  +  }
  +  
   }
  
  
  
  1.3       +6 -0      logging-log4j/src/java/org/apache/log4j/pattern/LiteralPatternConverter.java
  
  Index: LiteralPatternConverter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/pattern/LiteralPatternConverter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LiteralPatternConverter.java	27 Feb 2004 16:47:32 -0000	1.2
  +++ LiteralPatternConverter.java	28 May 2004 16:28:56 -0000	1.3
  @@ -35,4 +35,10 @@
       
       return buf;
     }
  +  
  +  public String getName()
  +  {
  +      return "Literal";
  +  }
  +  
   }
  
  
  
  1.6       +6 -0      logging-log4j/src/java/org/apache/log4j/pattern/PropertiesPatternConverter.java
  
  Index: PropertiesPatternConverter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/pattern/PropertiesPatternConverter.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PropertiesPatternConverter.java	9 May 2004 18:37:56 -0000	1.5
  +++ PropertiesPatternConverter.java	28 May 2004 16:28:56 -0000	1.6
  @@ -72,4 +72,10 @@
   
           return buf;
       }
  +    
  +    public String getName()
  +    {
  +        return "Property";
  +    }
  +    
   }
  
  
  
  1.4       +6 -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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ThreadPatternConverter.java	27 Feb 2004 16:47:32 -0000	1.3
  +++ ThreadPatternConverter.java	28 May 2004 16:28:56 -0000	1.4
  @@ -41,4 +41,10 @@
   
       return buf;
     }
  +  
  +  public String getName()
  +  {
  +      return "Thread";
  +  }
  +
   }
  
  
  
  1.4       +6 -0      logging-log4j/src/java/org/apache/log4j/pattern/LevelPatternConverter.java
  
  Index: LevelPatternConverter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/pattern/LevelPatternConverter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LevelPatternConverter.java	27 Feb 2004 16:47:32 -0000	1.3
  +++ LevelPatternConverter.java	28 May 2004 16:28:56 -0000	1.4
  @@ -40,4 +40,10 @@
   
       return buf;
     }
  +  
  +  public String getName()
  +  {
  +      return "Level";
  +  }
  +  
   }
  
  
  
  1.3       +6 -0      logging-log4j/examples/src/pattern/CountingPatternConverter.java
  
  Index: CountingPatternConverter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/examples/src/pattern/CountingPatternConverter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CountingPatternConverter.java	27 Feb 2004 16:47:28 -0000	1.2
  +++ CountingPatternConverter.java	28 May 2004 16:28:57 -0000	1.3
  @@ -21,6 +21,8 @@
   
   
   public class CountingPatternConverter extends PatternConverter {
  +  static private final String NAME = "Count";
  +  
     StringBuffer buf;
     int counter = 0;
   
  @@ -36,5 +38,9 @@
         buf.setLength(0);
       }
       return buf.append(String.valueOf(++counter));
  +  }
  +  
  +  public String getName() {
  +    return NAME;
     }
   }
  
  
  
  1.3       +5 -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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Num343PatternConverter.java	27 Feb 2004 16:47:36 -0000	1.2
  +++ Num343PatternConverter.java	28 May 2004 16:28:57 -0000	1.3
  @@ -20,6 +20,7 @@
   
   
   public class Num343PatternConverter extends PatternConverter {
  +  static private final String NAME = "Num34";
     StringBuffer buf;
   
     public Num343PatternConverter() {
  @@ -32,5 +33,9 @@
       buf.append("343");
   
       return buf;
  +  }
  +  
  +  public String getName() {
  +    return NAME;
     }
   }
  
  
  

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