logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anders Kristensen <akristen...@dynamicsoft.com>
Subject Re: Option data of user-defined conversion specifier
Date Fri, 22 Jun 2001 16:46:38 GMT
Agreed. I've made those methods protected in the CVS archive.

Anders

Ernie Parker wrote:
> 
> Hello Log4j,
> 
> I'm adding my own conversion specifier %v{option} using subclassed
> PatternLayout, PatternParser and PatternConverter.  I have a small
> problem with the {option} part. There doesn't seem to be a method for me
> to extract it. In the finalizeConverter method of my PatternParser subclass,
> I would like to be able to call
> 
>    addConverter(new MyPatternConverter(formattingInfo, extractOption()));
> 
> The problem is that extractOption() is a private method of PatternParser.
>  I can't access it from my subclass.
> 
> The org.apache.log4j.helpers.PatternParser has private methods,
> extractOption()and extractPrecisionOption(), which, I believe, should be
> protected so that a subclass, also, can access the option for conversion
> specifiers.  Interestingly enough, these methods access protected
> data members.  As a result I can copy the entire method in my subclass
> and everything works fine. But I'm sure that is not an approved way
> to modify the format buffer.
> 
> Maybe I've missed something in the architecture. If so, please let me know.
> 
> Regards,
> Ernest Parker
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Mime
View raw message