[logback-dev] Replacing CallerData class

Joern Huxhorn jhuxhorn at googlemail.com
Wed Mar 18 18:07:03 CET 2009


On 18.03.2009, at 17:35, Ceki Gulcu wrote:

> Joern Huxhorn wrote:
>
>> Extending StackTraceElement won't work because STE is a final class.
>
> Good point.
>
>> Why don't you simply use StackTraceElementProxy  instead of STE?  
>> That way, it could - optionally - also contain ClassPackagingData.
>
> As it stands, CallerData is almost identical to the StackTraceElement
> class. I don't expect CallerData to ever contain ClassPackagingData
> because collecting class packaging data is an extremely expensive
> operation, barely tolerable for exceptions but certainly not for every
> log statement.  I would be quite surprised if we ever wanted to
> replace CallerData/STE with STEProxy.

Well, I agree with your performance argument but the CPD field of  
STEProxy doesn't need to be used in the common case.

I'd use STEProxy simply to keep the possibility to activate such info  
on demand, i.e. while debugging but not in production.
It could certainly come in quite handy under some circumstances, e.g.  
while walking the path of jar hell.

Joern.


More information about the logback-dev mailing list