From dev-return-70036-apmail-cocoon-dev-archive=cocoon.apache.org@cocoon.apache.org Thu Jan 06 22:26:45 2005 Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 90316 invoked from network); 6 Jan 2005 22:26:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 6 Jan 2005 22:26:42 -0000 Received: (qmail 71123 invoked by uid 500); 6 Jan 2005 22:26:40 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 71047 invoked by uid 500); 6 Jan 2005 22:26:39 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 71032 invoked by uid 99); 6 Jan 2005 22:26:39 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from Unknown (HELO pulse.betaversion.org) (62.140.213.123) by apache.org (qpsmtpd/0.28) with SMTP; Thu, 06 Jan 2005 14:26:39 -0800 Received: (qmail 21000 invoked from network); 6 Jan 2005 22:26:36 -0000 Received: from unknown (HELO ?127.0.0.1?) (stefano@127.0.0.1) by pulse.betaversion.org with SMTP; 6 Jan 2005 22:26:36 -0000 Message-ID: <41DDBB1F.60909@apache.org> Date: Thu, 06 Jan 2005 17:26:39 -0500 From: Stefano Mazzocchi Organization: Apache Software Foundation User-Agent: Mozilla Thunderbird 1.0 (Macintosh/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: [RT] Logging in 2.2 References: <41DBD357.1000802@apache.org> <34692.10.0.0.5.1104943544.squirrel@www.agssa.net> <41DC5120.1040505@apache.org> <7557e99f05010513552789f631@mail.gmail.com> In-Reply-To: <7557e99f05010513552789f631@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Gianugo Rabellino wrote: > On Wed, 05 Jan 2005 15:42:08 -0500, Stefano Mazzocchi > wrote: > >>Nicola Ken Barozzi wrote: >> >>>Antonio Gallardo wrote: > > >>>I saw that too, but UGLI should not need that extra isLogEnabled stuff >>>in any case. > > > How so? What am I missing? > > >>>As noted in my previous message, UGLI also supports parameterized log >>>messages obliterating the need to surround log messages with >>>logger.isXXXEnabled checks. >>> >>>Instead of writing: >>> >>> if(logger.isDebugEnabled()) { >>> logger.debug("User with "+id+" entered wrong query string >>>["+query"]." ); >>> } >>> >>>you can just write: >>> >>> logger.debug("User with {} entered wrong query string [{}].", id, >>>query); >>>" >> >>very pythonish. I like it :-) >> >>-1 on just4log then. > > > I'm probably not getting the point. This solves the string > concatenation issue (which, besides and AFAIU, today is quite a bit > faster than it used to be in older JVMs), but isn't necessarily, and > per se, a permanent solution. Since this is an interface (and quite > an ugly one given the two parameter limitation... what's wrong with a > logger.xxx(String message, String[] params) as an alternative?), you > don't know if the current implementation just tokenizes the message > and performs concatenation anyway. Moreover, this is no solution to > logger.debug("my {} message", runMeAndIllKillYourMachine()) which > still would need to be wrapped... right, forget what I said. -- Stefano.