Return-Path: Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 94575 invoked from network); 18 Feb 2001 18:35:48 -0000 Received: from mail.ursus.ru (HELO ursus.ru) (195.96.66.197) by h31.sny.collab.net with SMTP; 18 Feb 2001 18:35:48 -0000 Received: from [195.96.66.194] (HELO anthony) by ursus.ru (Stalker SMTP Server 1.7) with SMTP id S.0000250702 for ; Sun, 18 Feb 2001 21:34:02 +0400 From: "Tagunov Anthony" To: "cocoon-dev@xml.apache.org" Date: Sun, 18 Feb 2001 21:38:58 +0300 Reply-To: "Tagunov Anthony" Priority: Normal X-Mailer: PMMail 2000 Professional (2.10.2010) For Windows NT (4.0.1381;6) In-Reply-To: <3A8FEB4B.34678010@apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Subject: Re: log performance penalties Message-Id: X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Hello, Cocooners! On Sun, 18 Feb 2001 16:33:31 +0100, Stefano Mazzocchi wrote: >Tagunov Anthony wrote: >> >> Hello, evrybody! >> >> On Thu, 15 Feb 2001 15:49:24 +0100, Stefano Mazzocchi wrote: >> >> >I'm looking at the changes made to Cocoon while I was away: >> > >> >are you guys aware of the fact that something like >> > >> > getLogger().debug("Making URL from " + location); >> >> Maybe doing something like getLogger().debug("Making URL from",location) >> would make things easier? > >Hmmm, what if you want to log something like > > "this " + code + " has been " + action + " at time " + time > >??? Sure, this approach is not universal.. 1) As for number of parameters: i personally see no trouble in having 9 .log methods with number of parameters from 1 to 9 respecitvely, if it saves performance! And I beleive there's a sane limit that a regular log request does not come over.. 2) parameter types, yes, this is the real trouble there's one more trick from my practice that i can propose: to log "this " + code + " has been " + action + " at time " + time one could getLogger().debug("this"); getLogger().debug(code); getLogger().debug("has been")... getLogger().debugNewLine(); and the logger would have debug(int), debug(String), debug(Time) methods and would sum up them in it's internal (kept per-thread) StringBuffer (so there's either a logger instance per thread, or each logger keeps per-thread information). The call degubNewLine() would actuall take the whole accumulated buffer and put it to the log. I used this approach in .cpp programs to avoid hussle with putting "this"+code+"has been" before doing a log() call. In C this resulted in even shorter and more understandable code. In Java it won't, but if it save performance.. >> I'm speaking about implementing things like debub(String), debug(String,String), debug(String,String,String)? >> That's what i do for my applications (non-cocoon) > >It's in these situations I wished java was aspect oriented :( > >-- >Stefano Mazzocchi One must still have chaos in oneself to be > able to give birth to a dancing star. > Friedrich Nietzsche >-------------------------------------------------------------------- > >--------------------------------------------------------------------- >To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org >For additional commands, email: cocoon-dev-help@xml.apache.org > >