Curt -

Thanks for the fly-by-night introduction. This is what I was thinking in
more detail. Again I know this is Java 5, so this would be for Log4J 2.0,
although perhaps something comparable could be devised for the current
Log4J. I'll just use debug as an example.

I find myself frequently logging like this...

Logger.debug(String.format("First object '%s', second object '%s'", first,
second));

When I wish I could just be logging like this..

Logger.debug("First object '%s', second object '%s'", first, second);

The new signature I feel is missing would be something like this...

public static debug(String message, String ... arguments)

After briefly looking at LogMF, this might be doing the same thing. I'm not
familiar with MessageFormat, so I don't know if the usage for the "pattern"
argument is the same or different from String.format() in Java 5.

352<http://logging.apache.org/log4j/companions/extras/xref/org/apache/log4j/LogMF.html#352>
*/****
353<http://logging.apache.org/log4j/companions/extras/xref/org/apache/log4j/LogMF.html#353>
* * Log a parameterized message at debug level.*
354<http://logging.apache.org/log4j/companions/extras/xref/org/apache/log4j/LogMF.html#354>
* * @param logger logger, may not be null.*
355<http://logging.apache.org/log4j/companions/extras/xref/org/apache/log4j/LogMF.html#355>
* * @param pattern pattern, may be null.*
356<http://logging.apache.org/log4j/companions/extras/xref/org/apache/log4j/LogMF.html#356>
* * @param arguments an array of arguments to be formatted and substituted.*
357<http://logging.apache.org/log4j/companions/extras/xref/org/apache/log4j/LogMF.html#357>
* */*
358<http://logging.apache.org/log4j/companions/extras/xref/org/apache/log4j/LogMF.html#358>
*public* *static* *void* debug(*final* Logger logger, *final* String
pattern,
359<http://logging.apache.org/log4j/companions/extras/xref/org/apache/log4j/LogMF.html#359>
*final* Object[] arguments) {
360<http://logging.apache.org/log4j/companions/extras/xref/org/apache/log4j/LogMF.html#360>
*if* (logger.isDebugEnabled()) {
361<http://logging.apache.org/log4j/companions/extras/xref/org/apache/log4j/LogMF.html#361>forcedLog(logger,
Level.DEBUG, format(pattern, arguments));
362<http://logging.apache.org/log4j/companions/extras/xref/org/apache/log4j/LogMF.html#362>}
363<http://logging.apache.org/log4j/companions/extras/xref/org/apache/log4j/LogMF.html#363>}


Thoughts?

Kathy

On Feb 9, 2008 3:59 PM, Curt Arnold <[EMAIL PROTECTED]> wrote:

>
> On Feb 9, 2008, at 11:05 AM, Katherine Hale wrote:
>
> > Hello! I have checked out the sandbox via SVN, I'm familiar with ANT
> > & test cases and all that good stuff. The readme said I should post
> > here to contribute. If anyone wants to send me information about
> > exactly where to submit a contribution that would be useful.
> >
> > Thanks!
> >
> > Kathy
>
> The best approach is to discuss your ideas, requirements, plans,
> possible contribution etc on the mailing list before starting to
> code.  The ASF is all about community developed software, it is much
> preferable to start with openly discussed ideas and then code then to
> drop a substantial body of code and expect the community try to
> comprehend it.  It is very helpful to have the design discussions on
> the mailing list for future reference.  There are some parts of log4j
> that were dropped in without any prior discussion which makes them
> hard to support and enhance.
>
> Have you looked at LogMF in the extras companion?  LogMF provides a
> static utility class to prepare logging requests using
> java.text.MessageFormat. The signatures of LogMF were designed to
> offer vararg like behavior to users of JDK's prior to JDK 1.5 and can
> take advantage of varargs with JDK 1.5 and later if you hit a pattern
> that wasn't supported.  LogSF is like LogMF, but uses a formatter
> similar to that provided in the discontinued log4j 1.3 development.
>
> There had been a LogF in the sandbox earlier that used
> java.util.Formatter which was introduced in JDK 1.5.  Development was
> suspended, but it could be resurrected anytime there is interest.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to