Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 19854 invoked from network); 29 Feb 2004 00:37:44 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 29 Feb 2004 00:37:44 -0000 Received: (qmail 20775 invoked by uid 500); 29 Feb 2004 00:37:26 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 20460 invoked by uid 500); 29 Feb 2004 00:37:24 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 20446 invoked from network); 29 Feb 2004 00:37:24 -0000 Received: from unknown (HELO exchange.sun.com) (192.18.33.10) by daedalus.apache.org with SMTP; 29 Feb 2004 00:37:24 -0000 Received: (qmail 19372 invoked by uid 50); 29 Feb 2004 00:37:57 -0000 Date: 29 Feb 2004 00:37:57 -0000 Message-ID: <20040229003757.19371.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: commons-dev@jakarta.apache.org Cc: Subject: DO NOT REPLY [Bug 27135] - [logging] SimpleLog log method should defer writing for better reuse! X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27135 [logging] SimpleLog log method should defer writing for better reuse! ------- Additional Comments From simon@ecnetwork.co.nz 2004-02-29 00:37 ------- I'm in favour of Aaron's proposal to add a doWrite(StringBuffer s) method. This extra virtual method call occurs only after it is determined that the message *will* be output. Performance is critical when determining *if* a message will be logged, but given that we have now committed to doing IO (which is always slow), I don't see an extra virtual method call being significant at that point. Robert, I think the Log interface is sufficiently complex to make reuse-by-delegation a pain; inheritance seems cleaner to me in this case. And it seems a quite common use-case too; using all the standard SimpleLog functionality but directing the output to some custom destination. I also think the doWrite method should take StringBuffer, not String, as a parameter, just in case the doWrite method wants to tweak the output string some more. Yes this commits the log() method to using StringBuffers forever more, but I can't see why it would ever want to use anything else. Still, this could be debated... --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org