Hello Ceki,

2005/10/26, Ceki Gülcü <[EMAIL PROTECTED]>:
I think it is a great idea. When you say it would be easy in case of
JDK 1.4, are you thinking of the Throwable.fillInStackTrace() method
introduced in JDK 1.4? The javadoc for that method states:

   Some virtual machines may, under some circumstances, omit one or
   more stack frames from the stack trace. In the extreme case, a virtual
   machine that has no stack trace information concerning this throwable
   is permitted to return a zero-length array from this method. Generally
   speaking, the array returned by this method will contain one element
   for every frame that would be printed by printStackTrace.

If the said "omitted stack frame" is the one identifying the caller,
then the logger name computed by LoggerFactory.getLogger() would be
wrong, with potentially very unpleasant results. :-)

Would you concur?

It seems like the quoted documentation is for 'getStackTrace()' method. :)

Anyway, you're right.  But what about parsing stack trace strings to find out the class name?  This should work for most virtual machines.  In case of failure we could throw a RuntimeException to trigger ExceptionInitializerError.

Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
_______________________________________________
user mailing list
[email protected]
http://slf4j.org/mailman/listinfo/user

Reply via email to