commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Caswell <steven.casw...@gmail.com>
Subject Re: [lang] ExceptionUtils methods
Date Sun, 13 Nov 2005 12:57:12 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message