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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Steven Caswell
[EMAIL PROTECTED]

(c) 404-693-4148
(o) 404-260-2382

Take back the web - http://www.mozilla.org

Reply via email to