[slf4j-user] Varargs for Logger methods
Ceki Gülcü
listid at qos.ch
Thu Feb 16 10:58:57 CET 2006
Hello Ankostis,
At 01:06 AM 2/16/2006, Kostis Anagnostopoulos wrote:
>Hi to everyone,
>
>i find this project very interesting for its simplicity and logging
>frameworks coverage.
Thank you.
>I have my self tried to implement similar functionality in the past,
>ending up re-inventing the wheel in every project i participate.
>
>Here is my 2 questions/RFEs:
>
>* What is the roadplan for incorporating 1.5 varargs for object params of
>formated message strings ?
>For instance,
>
> debug(String msg, Object... params) {
> ....
> }
Recent reports show that over 60% of java deployments still use JDK 1.4,
with JDK 1.3 and 1.5 roughly at 20% each. Although varargs could
significantly reduce the number of methods included in SLF4J's logger
interface, the current plan is to target JDK 1.4. I do not see the target
platform changing in the next 24 months and probably longer than that.
>* If indeed there is a plan, how can this be done?
Several experiments show that modifying o.s.Logger for varargs use would be
fairly straightforward. Existing clients would need to recompile their code
against the "upgraded" SLF4J API. No other changes would be necessary.
However, it would *not* be possible to mix classes compiled against SLF4J
versions targeting 1.4 and those targeting 1.5. For a library with a very
large number of dependents like SLF4J, we cannot afford to break
compatibility, especially runtime compatibility. It follows that once the
SLF4J is released (as 1.0final), it will always target 1.4.
Theoretically, we could still ask permission from existing clients to
upgrade to 1.5. Such an upgrade offers minor advantages for developers
writing SLF4J adapters (3 or 4 individuals in the world). However, I think
that varargs upgrade offers no advantages for SLF4J *clients*. More
importantly, even at this relatively early stage incompatible changes would
affect hundreds or even thousands of clients depending on SLF4J.
In summary, SLF4J currently targets the 1.4 platform. Given that for
end-users there are no real benefits for a varargs upgrade, SLF4J will
continue to target 1.4 for a very long time.
Does this satisfactorily answer your question?
>Will it require
> 1. a new Logger interface,
> 2. and a new family of adapter classes
> 3. packed in seperate jars, that will a) be named differently, b)
> versioned diferently.
>
>
> ankostis
--
Ceki Gülcü
More information about the slf4j-user
mailing list