[slf4j-user] varargs

Martin Gilday martin.lists at imap.cc
Fri Nov 10 12:16:05 CET 2006


Sounds like the most reasonable solution.
The only other alternative I can think of is to have a "Logger5"
inteface which entends the current Logger with the varargs method on it,
and then have an extended class for each implementation which adds the
new method on.  These could be stored in an additional artifact similar
to how Opensymphony have an xwork-tiger set of extensions.  This would
require users to use an alternative interface and mean lots of
additional classes to maintain, so it is far from ideal.  Changing the
base JDK requirement seems the easiet solution, but are you not worried
about alienating those who still must work to 1.4?


----- Original message -----
From: "Ceki Gülcü" <listid at qos.ch>
To: "User list for the slf4j project" <user at slf4j.org>
Date: Thu, 09 Nov 2006 23:23:16 +0100
Subject: Re: [slf4j-user] varargs


Zohar, Martin,

I've just done a compatibility review. Changing the Logger interface
from

public interface Logger {
  public void debug(String msg);
  public void debug(String format, Object arg);
  public void debug(String format, Object arg1, Object arg2);
  public void debug(String format, Object[] argArray);
}

to:

public interface Logger {
  public void debug(String msg);
  public void debug(String format, Object arg);
  public void debug(String format, Object arg1, Object arg2);
  public void debug(String format, Object...);
}

The second form requires JDK 1.5.

The second form still yields good performance for the common
cases with 0,1 and 2 args. Most importantly. clients compiled against
the 1st (JDK14) version would continue to run as in the presence of
the second interface (JDK15).

At present time, I'd like to release 1.1 without any more significant
changes. If existing users do not object, in the next SLF4J release,
namely
1.2, we could bump the JDK requirement to 1.5 instead of 1.4.

How does that sound?


At 10:30 PM 11/9/2006, you wrote:
>Hi Zohar,
>
>I had the same request a few weeks ago and created a feature request for
>it [1].  The main problem seems to be keeping 1.4 support, without
>creating additional Java 5 classes (many more classes would need to be
>created as there would need to be numerous per each logging
>implementation).  I have been considering creating a wrapper class in
>the meantime.  Hopefully something will be worked out for 1.1.
>
>hope that helped,
>Martin.
>
>[1] http://bugzilla.slf4j.org/show_bug.cgi?id=31
>
>
>----- Original message -----
>From: "Zohar" <david_fire4 at hotmail.com>
>To: user at slf4j.org
>Date: Thu, 9 Nov 2006 10:02:42 +0200
>Subject: [slf4j-user] varargs
>
>Hello,
>I'm new to SLF4J.
>Looking at the API I noticed there's no logging methods with varargs. I
>understand that this is a Java5 feature and SLF4J supports JDK 1.4, but
>is
>there a chance to have a version which supports Java5 features? It's
>just
>that varargs is so appropriate for logging...
>Thanks,
>Zohar.
>
>_______________________________________________
>user mailing list
>user at slf4j.org
>http://www.slf4j.org/mailman/listinfo/user
>_______________________________________________
>user mailing list
>user at slf4j.org
>http://www.slf4j.org/mailman/listinfo/user

-- 
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for
Java.
http://logback.qos.ch

_______________________________________________
user mailing list
user at slf4j.org
http://www.slf4j.org/mailman/listinfo/user



More information about the slf4j-user mailing list