logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From psm...@apache.org
Subject cvs commit: logging-log4j/src/java/org/apache/log4j/pattern ClassNamePatternConverter.java LineLocationPatternConverter.java FullLocationPatternConverter.java FileLocationPatternConverter.java MethodLocationPatternConverter.java
Date Mon, 10 May 2004 22:24:22 GMT
psmith      2004/05/10 15:24:22

  Modified:    src/java/org/apache/log4j/pattern
                        ClassNamePatternConverter.java
                        LineLocationPatternConverter.java
                        FullLocationPatternConverter.java
                        FileLocationPatternConverter.java
                        MethodLocationPatternConverter.java
  Log:
  ocationInfo not always non-null... At least not when the Chainsaw Generator
  creates it.
  
  Just adds a simple if.
  
  Revision  Changes    Path
  1.4       +1 -1      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ClassNamePatternConverter.java	27 Feb 2004 16:47:32 -0000	1.3
  +++ ClassNamePatternConverter.java	10 May 2004 22:24:22 -0000	1.4
  @@ -35,7 +35,7 @@
     }
     
     String getFullyQualifiedName(LoggingEvent event) {
  -	   return event.getLocationInformation().getClassName();
  +	   return event.getLocationInformation()!=null?event.getLocationInformation().getClassName():"";
   	 }
     
   }
  
  
  
  1.4       +3 -1      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LineLocationPatternConverter.java	27 Feb 2004 16:47:32 -0000	1.3
  +++ LineLocationPatternConverter.java	10 May 2004 22:24:22 -0000	1.4
  @@ -40,7 +40,9 @@
       buf.setLength(0);
   
   	  LocationInfo locationInfo = event.getLocationInformation();
  -    buf.append(locationInfo.getLineNumber());
  +    if (locationInfo!=null) {
  +			buf.append(locationInfo.getLineNumber());
  +		}
   
       return buf;
     }
  
  
  
  1.4       +3 -1      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FullLocationPatternConverter.java	27 Feb 2004 16:47:32 -0000	1.3
  +++ FullLocationPatternConverter.java	10 May 2004 22:24:22 -0000	1.4
  @@ -40,7 +40,9 @@
       buf.setLength(0);
   
   	  LocationInfo locationInfo = event.getLocationInformation();
  -    buf.append(locationInfo.fullInfo);
  +    if (locationInfo!=null) {
  +			buf.append(locationInfo.fullInfo);
  +		}
   
       return buf;
     }
  
  
  
  1.4       +4 -2      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FileLocationPatternConverter.java	27 Feb 2004 16:47:32 -0000	1.3
  +++ FileLocationPatternConverter.java	10 May 2004 22:24:22 -0000	1.4
  @@ -39,8 +39,10 @@
     public StringBuffer convert(LoggingEvent event) {
       buf.setLength(0);
   
  -	  LocationInfo locationInfo = event.getLocationInformation();
  -    buf.append(locationInfo.getFileName());
  +	LocationInfo locationInfo = event.getLocationInformation();
  +    if (locationInfo!=null) {
  +    	buf.append(locationInfo.getFileName());
  +    }
   
       return buf;
     }
  
  
  
  1.4       +3 -1      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MethodLocationPatternConverter.java	27 Feb 2004 16:47:32 -0000	1.3
  +++ MethodLocationPatternConverter.java	10 May 2004 22:24:22 -0000	1.4
  @@ -40,7 +40,9 @@
       buf.setLength(0);
   
   	  LocationInfo locationInfo = event.getLocationInformation();
  -    buf.append(locationInfo.getMethodName());
  +    if (locationInfo!=null) {
  +			buf.append(locationInfo.getMethodName());
  +		}
   
       return buf;
     }
  
  
  

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