[slf4j-dev] [Bug 31] Varargs for Logger methods

bugzilla-daemon at pixie.qos.ch bugzilla-daemon at pixie.qos.ch
Sat Nov 14 12:41:27 CET 2009


http://bugzilla.slf4j.org/show_bug.cgi?id=31





--- Comment #54 from Ceki Gulcu <listid at qos.ch>  2009-11-14 12:41:26 ---
Any migration to from the current API to a new API must be transparent. Just
keep in mind that for some users, having to install a binding, such as
slf4j-jdk14.jar or slf4j-log4j12.jar, is already too much to ask. They get
confused, and then they complain, start calling names, etc. Proposing a
migration path where *existing* SLF4J users have to change their org.slf4j
imports is not going to fly. 

Given the number of SLF4J users, any change to the existing org.slf4j.Logger
interface must be transparent to the end-user which is, I have to admit, an
extremely restrictive requirement.  Sorry Joern.

If people were in my head, or more accurately if I was in theirs controlling
their minds, no one would object to perceived problems in the SLF4J API. 

For 3 or more varargs, they would either write

a) logger.debug("and the winning numbers are {}, {}, {}.", new Integer[] {n0,
n1, n2});

or

b) if(logger.isDebugEnabled()) {
     logger.debug("and the winning numbers are "+n0"+","+n1+","+n2+".");
   }  

For the case with exceptions they would simply write

  logger.error("temperature too high "+temperature, exception);

No parameterized logging is necessary in this case as there is no performance
issue. (How many times do you throw an exception?)

Obviously, people located 500km away can't read my mind, and have different
expectations about what the logging API should be like, which is only natural.
However, any change should also factor this in. Developers will be hissing and
cussing if they have to change their imports. You will be thinking "it's just
changing the import", and they will be thinking "which idiot came up this? who
has rope and where is the nearest tall tree?"


-- 
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the slf4j-dev mailing list