views:

402

answers:

3

I want to get rid of this lot...

public void info(String msg);
public void info(String format, Object arg);
public void info(String format, Object arg1, Object arg2);
public void info(String format, Object[] argArray);

...and replace it with this one...

public void info(String format, Object ... args);

...so that my logging syntax doesn't have to change depending on the number of arguments I want to log. There seems to be lots of discussion and work around it, but where is it? Or should I wrap the wrapper that is slf4j?

+1  A: 

From reading the SLF4J javadoc for Logger the simple answer would appear to be no. From what I have read they want to stay compatible with older versions of the JDK.

If you are not really tied to using SLF4J then maybe log5j is an option?

Mark
+1 for the log5j reference -- sounds neat!
Jason S
+2  A: 

No.

The issue is still open how to do it right while still maintaining 100% backwards compatibility.

Feel free to see the discussion at http://bugzilla.slf4j.org/show%5Fbug.cgi?id=31

Thorbjørn Ravn Andersen
+3  A: 

The real question is "Why must must a jdk < 5 be supported by this any longer"? If you have an older version of java, then use the older API. It's that simple. Why not make this fit better into the current java world? I mean, JDK 5 isn't even even supported without a support contract from Sun/Oracle. Backward compatibility is a joke in this case.

Briggs