commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory" <ggreg...@seagullsoftware.com>
Subject RE: [lang] ExceptionUtils methods
Date Mon, 14 Nov 2005 00:50:43 GMT
Hello:

I agree with Steven on naming. One kind of usage, logging, should not be
reflected in the API name.

Gary

> -----Original Message-----
> From: Steven Caswell [mailto:steven.caswell@gmail.com]
> Sent: Sunday, November 13, 2005 4:57 AM
> To: Jakarta Commons Developers List
> Subject: Re: [lang] ExceptionUtils methods
> 
> Sounds like a good idea to me. I would probably choose to not put
"Log" in
> the method names, i.e. getMessageNoStack trace and
> getMessageShortStackTrace, since the methods don't specifically deal
with
> logging and there is no requirement to use the results in a log
mesage.
> But
> I don;t have a strong preference either way, so if there is a
concensus
> I'm
> fine with that.
> 
> On 11/12/05, Stephen Colebourne <scolebourne@btopenworld.com> wrote:
> >
> > Could I propose some new methods for ExceptionUtils:
> >
> > - ExceptionUtils.getLogMessageNoStackTrace(ex)
> >
> > Returns a string of the form:
> > IllegalArgumentException: Person must have a surname
> > <ClassNameNoPackage>: <Message>
> >
> > - ExceptionUtils.getLogMessageShortStackTrace(ex, lines)
> >
> > 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()
> >
> > Potentially a variation on this could filter out certain stack trace
> > lines.
> >
> >
> > 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!)?
> >
> > Stephen
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
> >
> 
> 
> --
> Steven Caswell
> steven.caswell@gmail.com
> 
> (c) 404-693-4148
> (o) 404-260-2382
> 
> Take back the web - http://www.mozilla.org

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message