logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Re: Pattern specifiers for abbreviated logger and class names
Date Sat, 26 Feb 2005 06:45:36 GMT

On Feb 25, 2005, at 9:42 PM, Paul Smith wrote:

> I would love this feature.  I like the way Eclipse allows you to do 
> this.  Copied from the Java->Appearance tab of Eclipse preferences:
>
> "Compression pattern (e.g givin a package name 'org.eclipse.jdt' 
> pattern '.' will compress it to '..jdt' '0' to 'jdt', '1~' to 
> 'o~.e~jdt')"
>
> We should probably have different pattern specificier chars, and keep 
> the exitsing syntax and meaning.
>

I was leaning toward abbreviating to fit the width.  There is some 
precedent for this in the floating point conversion patterns with will 
start dropping elements like leading zeros or "e" or "+" to fit within 
the specified width.  If the width is less than the logger name, you 
will have already started dropping info.  We'd just be improving the 
discard method.

Currently, "%c{1}" or "%logger{1}" would get you "jdt", "%c{2}" would 
get you "eclipse.jdt", so the first parameter a kind of compression 
specifier.  We could just expand the acceptable contents of the brace:

"%c{1.}"    -> "o.e.jdt"
"%c{2.}"    -> "or.ec.jdt"
"%c{1~}"  -> "o~.e~.jdt"
"%c{.}" or "%c{0.}" -> "..jdt"
"%c{1.*.}"  -> "o.eclipse.jdt"

I think abbreviating to fit width would be substantially simpler to 
implement and explain, however.


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


Mime
View raw message