[slf4j-user] Re: Re: Varargs for Logger methods

Kostis Anagnostopoulos ankostis at gmail.com
Thu Feb 16 13:25:26 CET 2006


Thank you for your quick response,

At Thu Feb 16 10:58:57 CET 2006, Ceki Gülcü wrote:
>....
>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.

Not even this!  Existing clients (those that are not using varags) would
require no recompilation, unless the API changes in a non-compatible way
(ie, some of its methods removed).
So, lets leave the old ones (those with 2 object params) and
just add the varag-ified ones.

Only newly-written clients that take advantage of the new varg-ified API
require compile.


>However, it would *not* be possible to mix classes compiled against SLF4J
>versions targeting 1.4  and those targeting 1.5.

Why is that?
Code compiled against 1.4 and non-varag SLF4J would also run
in VM 1.5.
Also if the varag-ified SLF4J API is modified compatible (see above),
then it would run OK.

Am i missing something here?


>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*.
>...

Actually it is the contrary!  Since the adapter developers are about 3-4
their great benefit is small, when compared to the minor benefit of
 thousands of clients.

I'm bringing up the varargs matter  because it would help me
to avoid instanciating a new Object[] just to pass params to messages.
I think it is the *client code* for java 1.5 that would get the most benefit.

>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.
>.....
>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.

Earlier you said that reports show java 1.5 usage to be at about 20%.

In 1 or 2 years from now, would the percentages remain the same ?
Or will it be like todays java's 1.4 usage percent, around 60%,
and it would be java 1.4 that drops close to 20%?

It would be a pitty (amidst Mustang Beta release :), not to head for
the future.

So what am i proposing here is to have the possibility to use 2 different
implementations for SLF4J, one for pre-1.5 and one for post 1.5 VMs.

>....
>Ceki Gülcü


Hope you find my comments debatable,
and my mail at the correct list...

    ankostis



More information about the slf4j-user mailing list