You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Nicola Ken Barozzi <ni...@apache.org> on 2003/07/04 16:39:31 UTC
Varargs in JDK 1.5 will help loggers (a bit)
With Java 1.5, AKA Tiger, Java will get varargs support, which means
that methods can have a variable number of parameters.
Imagine
log("The error", a, c, exception, f[i])
Instead of
log("The error "+ a + "\n"+ c + exception.toString + String.valueOf(f[i]))
@see http://www.madbean.com/blog/22/
--
Nicola Ken Barozzi nicolaken@apache.org
- verba volant, scripta manent -
(discussions get forgotten, just code remains)
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org
Re: Varargs in JDK 1.5 will help loggers (a bit)
Posted by Raymond DeCampo <rd...@twcny.rr.com>.
Nicola Ken Barozzi wrote:
>
> With Java 1.5, AKA Tiger, Java will get varargs support, which means
> that methods can have a variable number of parameters.
>
> Imagine
>
> log("The error", a, c, exception, f[i])
>
> Instead of
>
> log("The error "+ a + "\n"+ c + exception.toString + String.valueOf(f[i]))
>
> @see http://www.madbean.com/blog/22/
>
One could already accomplish the same thing with
log(new Object[] {"The error ", a, "\n", c, exception, f[i]});
So what was the rationale behind introducing the new syntax?
Ray
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org