[logback-dev] Replacing CallerData class

Joern Huxhorn jhuxhorn at googlemail.com
Wed Mar 18 16:52:31 CET 2009


On 18.03.2009, at 14:52, Ralph Goers wrote:

> The only concern I would have is that it would break an existing  
> user's code to remove it. I realize the version is still  
> 0.9.something, but at this point Logback is being used in  
> production, probably in lots of places.
>
> What I would suggest is to change all the Logback code to use  
> StackTraceElement but deprecate CallerData and the getCallerData  
> method and then have CallerData extend StackTraceElement as a  
> wrapper. Make sure you add getStackTrace to the LoggingEvent.  
> getCallerData could then create the CallerData array from the  
> StackTrace array.

Extending StackTraceElement won't work because STE is a final class.


> On Mar 18, 2009, at 4:12 AM, Ceki Gulcu wrote:
>
>> I would like to replace the CallerData class with
>> StackTraceElement. The two classes contain the same fields.
>> StackTraceElement is part of the JDK. I can think of no valid reason
>> to duplicate a class found in the JDK.
>>
>> Comments/objections?

No real objection.
Why don't you simply use StackTraceElementProxy  instead of STE? That  
way, it could - optionally - also contain ClassPackagingData.

Joern.


More information about the logback-dev mailing list