Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 398 invoked from network); 14 Nov 2005 01:04:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Nov 2005 01:04:28 -0000 Received: (qmail 13105 invoked by uid 500); 14 Nov 2005 01:04:27 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 12546 invoked by uid 500); 14 Nov 2005 01:04:25 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: 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 12535 invoked by uid 99); 14 Nov 2005 01:04:25 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Nov 2005 17:04:25 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of ggregory@seagullsoftware.com designates 12.6.96.2 as permitted sender) Received: from [12.6.96.2] (HELO mailer.seagullsoftware.com) (12.6.96.2) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Nov 2005 17:04:17 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [lang] ExceptionUtils methods Date: Sun, 13 Nov 2005 20:04:03 -0500 Message-ID: <19B78354A4AA3E4287384F3D30933F882E9CB6@MAIL1.seagull.nl> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [lang] ExceptionUtils methods thread-index: AcXngPLy/AgSfBm0SqmQZnWFL5vWEgBNWBiw From: "Gary Gregory" To: "Jakarta Commons Developers List" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hello: I am wondering if a "toXXX" name is not more appropriate since you are converting rather than getting: ExceptionUtils.toMessageNoStackTrace(ex) Or simply: ExceptionUtils.toMessage(ex) Also, I wonder if 'Short' is really useful, if I give it 1000 lines, it's not short. I think you just omit the bias issue by calling it: ExceptionUtils.toMessage (ex, stackFrameCount) Here, a descriptive parameter name like stackFrameCount avoids the need to have a more complicated API name. Gary > -----Original Message----- > From: Stephen Colebourne [mailto:scolebourne@btopenworld.com] > Sent: Saturday, November 12, 2005 4:02 AM > To: Jakarta Commons Developers List > Subject: [lang] ExceptionUtils methods >=20 > Could I propose some new methods for ExceptionUtils: >=20 > - ExceptionUtils.getLogMessageNoStackTrace(ex) >=20 > Returns a string of the form: > IllegalArgumentException: Person must have a surname > : >=20 > - ExceptionUtils.getLogMessageShortStackTrace(ex, lines) >=20 > Returns the same as above but with a short stack trace, eg for 2 lines: > IllegalArgumentException: Person must have a surname > at org.apache.program.ValidatePerson.validate() > at org.apache.program.Validator.validate() >=20 > Potentially a variation on this could filter out certain stack trace > lines. >=20 >=20 > All code would be carefully null protected and designed for log > messages. I think this is useful, but maybe it should form part of the > logging tool (as well!)? >=20 > Stephen >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-dev-help@jakarta.apache.org >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org