ceki 01/04/22 07:02:40 Modified: docs HISTORY src/java/org/apache/log4j/spi LocationInfo.java Log: Added support for getClassName for VA environments. Revision Changes Path 1.37 +10 -0 jakarta-log4j/docs/HISTORY Index: HISTORY =================================================================== RCS file: /home/cvs/jakarta-log4j/docs/HISTORY,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- HISTORY 2001/04/22 12:03:52 1.36 +++ HISTORY 2001/04/22 14:02:39 1.37 @@ -6,6 +6,16 @@ [***] Changes requiring important modifications to existing client code. + April 22, 2001 + + - Release of version 1.1b5 + + - + + - Corrected the incorrect value retutned by LocationInfo.getClassName + method when running under Visual Age. Thanks to Mathias Rupprecht + for supplying the relevant patch. + April 20, 2001 - Release of version 1.1b4 1.5 +19 -2 jakarta-log4j/src/java/org/apache/log4j/spi/LocationInfo.java Index: LocationInfo.java =================================================================== RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/spi/LocationInfo.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- LocationInfo.java 2001/04/22 13:11:57 1.4 +++ LocationInfo.java 2001/04/22 14:02:40 1.5 @@ -5,13 +5,15 @@ * License version 1.1, a copy of which has been included with this * distribution in the LICENSE.APL file. */ +// Contributors: Mathias Rupprecht <[EMAIL PROTECTED]> package org.apache.log4j.spi; import java.io.StringWriter; import java.io.PrintWriter; import org.apache.log4j.helpers.LogLog; -import org.apache.log4j.Layout;; +import org.apache.log4j.Layout; + /** The internal representation of caller location information. @@ -148,10 +150,25 @@ className = NA; else { iend = fullInfo.lastIndexOf('.', iend); + + // This is because a stack trace in VisualAge looks like: + + //java.lang.RuntimeException + // java.lang.Throwable() + // java.lang.Exception() + // java.lang.RuntimeException() + // void test.test.B.print() + // void test.test.A.printIndirect() + // void test.test.Run.main(java.lang.String []) + int ibegin = 0; + if (inVisualAge) { + ibegin = fullInfo.lastIndexOf(' ', iend)+1; + } + if(iend == -1) className = NA; else - className = this.fullInfo.substring(0, iend); + className = this.fullInfo.substring(ibegin, iend); } } return className; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]