From martin.lists at imap.cc Sat Oct 14 17:30:17 2006 From: martin.lists at imap.cc (Martin Gilday) Date: Sat, 14 Oct 2006 16:30:17 +0100 Subject: [slf4j-user] Varargs for Logger methods Message-ID: <1160839817.31264.273330023@webmail.messagingengine.com> Hi, I have just been evaluating SLFJ, looking to move over from JCL. I was pleased to come across the conveience log statements that reduce the need for isDebugEnabled if statements. My immediate reaction to this was that it would be a great place to use varargs. Searching this mailing list showed that this had been discussed before, with the outcome that it would not be added at the present time. Has there been any more thought given to integrating vararg support? Alternatively has any side projects or extensions been produced that do this for log4j/logback? Thanks, Martin Gilday. From bjorn at implior.se Sat Oct 14 18:21:08 2006 From: bjorn at implior.se (Bjorn Danielsson) Date: 14 Oct 2006 18:21:08 +0200 Subject: [slf4j-user] Varargs for Logger methods In-Reply-To: <1160839817.31264.273330023@webmail.messagingengine.com> References: <1160839817.31264.273330023@webmail.messagingengine.com> Message-ID: "Martin Gilday" wrote: > Hi, > I have just been evaluating SLFJ, looking to move over from JCL. I was > pleased to come across the conveience log statements that reduce the > need for isDebugEnabled if statements. My immediate reaction to this was > that it would be a great place to use varargs. Searching this mailing > list showed that this had been discussed before, with the outcome that > it would not be added at the present time. Has there been any more > thought given to integrating vararg support? Alternatively has any side > projects or extensions been produced that do this for log4j/logback? Varargs is just syntactic sugar for "new String() { x,y,z }", so it still allocates memory, not just stack/register space. At least this is how it works in java 1.5.0. It will slow down your code compared to using isDebugEnabled, due to increased number of garbage collections. I am not against use of vararg, because there are plenty of other arguments for it. I am just mentioning this fact about the current implementation of varargs. -- Bj?rn Danielsson Implior AB From listid at qos.ch Sun Oct 15 19:34:22 2006 From: listid at qos.ch (Ceki =?iso-8859-1?Q?G=FClc=FC?=) Date: Sun, 15 Oct 2006 19:34:22 +0200 Subject: [slf4j-user] Varargs for Logger methods In-Reply-To: <1160839817.31264.273330023@webmail.messagingengine.com> References: <1160839817.31264.273330023@webmail.messagingengine.com> Message-ID: <6.0.0.22.0.20061015190552.0424bca8@mail.qos.ch> Hello Martin, JDK 1.5 vargs support in org.slf4j.Logger class methods is one of the most frequently requested features. However, since SLF4J is intended to be compatible JDK 1.2 and above, we cannot add vargs support without breaking compatibility with older JDK's. Some of our users expect SLF4J to be JDK 1.4 compatible. It would be quite inappropriate to pull the rug under their feet. However, if there is a way to preserve compatibility with existing clients (both compile time and run time), then I'd be glad add vararg support to SLF4J. In practice see [1], this means that we would need two versions of slf4j-API.jar, one targeting JDK 1.4 and one targeting JDK 1.5. If you care to submit a bug report, I'll be happy to revisit this issue closely before 1.1 final is released. As for vararg support in logback, since logback is a native implementation of SLF4J, if SLF4J API does not have it, then nor will logback. It is also true that if SLF4J has it, so will logback. [1] http://marc.theaimsgroup.com/?t=114004841000007&r=1&w=2 At 05:30 PM 10/14/2006, Martin Gilday wrote: >Hi, >I have just been evaluating SLFJ, looking to move over from JCL. I was >pleased to come across the conveience log statements that reduce the >need for isDebugEnabled if statements. My immediate reaction to this was >that it would be a great place to use varargs. Searching this mailing >list showed that this had been discussed before, with the outcome that >it would not be added at the present time. Has there been any more >thought given to integrating vararg support? Alternatively has any side >projects or extensions been produced that do this for log4j/logback? > >Thanks, >Martin Gilday. -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch From ankostis at gmail.com Mon Oct 16 06:23:56 2006 From: ankostis at gmail.com (Kostis Anagnostopoulos) Date: Mon, 16 Oct 2006 07:23:56 +0300 Subject: [slf4j-user] Varargs for Logger methods In-Reply-To: <6.0.0.22.0.20061015190552.0424bca8@mail.qos.ch> References: <1160839817.31264.273330023@webmail.messagingengine.com> <6.0.0.22.0.20061015190552.0424bca8@mail.qos.ch> Message-ID: Hi, since you are revisiting the varargs issue, please consider the 'throwable' argument's postion. See http://www.slf4j.org/pipermail/user/2006-February/000062.html for an older discussion with Ceki. In a nutshell, there is a problem if the current API extends to combine message arguments with exception. For intance, the following invocation is problematic: error("All {} are {}.", ex, "children", "sleeping"); Regards, Kostis On 10/15/06, Ceki G?lc? wrote: > Hello Martin, > > JDK 1.5 vargs support in org.slf4j.Logger class methods is one of the > most frequently requested features. However, since SLF4J is intended > to be compatible JDK 1.2 and above, we cannot add vargs support > without breaking compatibility with older JDK's. > > Some of our users expect SLF4J to be JDK 1.4 compatible. It > would be quite inappropriate to pull the rug under their feet. > > However, if there is a way to preserve compatibility with existing > clients (both compile time and run time), then I'd be glad add vararg > support to SLF4J. In practice see [1], this means that we would need two > versions of slf4j-API.jar, one targeting JDK 1.4 and one targeting JDK > 1.5. If you care to submit a bug report, I'll be happy to revisit this > issue closely before 1.1 final is released. > > As for vararg support in logback, since logback is a native > implementation of SLF4J, if SLF4J API does not have it, then nor will > logback. It is also true that if SLF4J has it, so will logback. > > [1] http://marc.theaimsgroup.com/?t=114004841000007&r=1&w=2 > > At 05:30 PM 10/14/2006, Martin Gilday wrote: > >Hi, > >I have just been evaluating SLFJ, looking to move over from JCL. I was > >pleased to come across the conveience log statements that reduce the > >need for isDebugEnabled if statements. My immediate reaction to this was > >that it would be a great place to use varargs. Searching this mailing > >list showed that this had been discussed before, with the outcome that > >it would not be added at the present time. Has there been any more > >thought given to integrating vararg support? Alternatively has any side > >projects or extensions been produced that do this for log4j/logback? > > > >Thanks, > >Martin Gilday. > > -- > Ceki G?lc? > Logback: The reliable, generic, fast and flexible logging framework for Java. > http://logback.qos.ch > > _______________________________________________ > user mailing list > user at slf4j.org > http://www.slf4j.org/mailman/listinfo/user > From martin.lists at imap.cc Mon Oct 16 16:46:05 2006 From: martin.lists at imap.cc (Martin Gilday) Date: Mon, 16 Oct 2006 15:46:05 +0100 Subject: [slf4j-user] Varargs for Logger methods In-Reply-To: <6.0.0.22.0.20061015190552.0424bca8@mail.qos.ch> References: <1160839817.31264.273330023@webmail.messagingengine.com> <6.0.0.22.0.20061015190552.0424bca8@mail.qos.ch> Message-ID: <1161009965.14208.273444633@webmail.messagingengine.com> Ceki, I have created this as Bug 31 [1]. Kostis, I have added in your concerns over the Throwable position to the bug report and a link to the mailing list discussion. [1] http://bugzilla.slf4j.org/show_bug.cgi?id=31 ----- Original message ----- From: "Ceki G?lc?" To: "User list for the slf4j project" Date: Sun, 15 Oct 2006 19:34:22 +0200 Subject: Re: [slf4j-user] Varargs for Logger methods Hello Martin, JDK 1.5 vargs support in org.slf4j.Logger class methods is one of the most frequently requested features. However, since SLF4J is intended to be compatible JDK 1.2 and above, we cannot add vargs support without breaking compatibility with older JDK's. Some of our users expect SLF4J to be JDK 1.4 compatible. It would be quite inappropriate to pull the rug under their feet. However, if there is a way to preserve compatibility with existing clients (both compile time and run time), then I'd be glad add vararg support to SLF4J. In practice see [1], this means that we would need two versions of slf4j-API.jar, one targeting JDK 1.4 and one targeting JDK 1.5. If you care to submit a bug report, I'll be happy to revisit this issue closely before 1.1 final is released. As for vararg support in logback, since logback is a native implementation of SLF4J, if SLF4J API does not have it, then nor will logback. It is also true that if SLF4J has it, so will logback. [1] http://marc.theaimsgroup.com/?t=114004841000007&r=1&w=2 At 05:30 PM 10/14/2006, Martin Gilday wrote: >Hi, >I have just been evaluating SLFJ, looking to move over from JCL. I was >pleased to come across the conveience log statements that reduce the >need for isDebugEnabled if statements. My immediate reaction to this was >that it would be a great place to use varargs. Searching this mailing >list showed that this had been discussed before, with the outcome that >it would not be added at the present time. Has there been any more >thought given to integrating vararg support? Alternatively has any side >projects or extensions been produced that do this for log4j/logback? > >Thanks, >Martin Gilday. -- Ceki G?lc? Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch _______________________________________________ user mailing list user at slf4j.org http://www.slf4j.org/mailman/listinfo/user