|
Re: OT: Bad examples everywhere (Was: distinguishing between failures and : msg#00138java.junit.user
[snip...] I've fallen in love with Log4J. Doing something like: catch (Exception ex) { log.error("Something bad happened here", ex) } is just a nice thing to have. Your own error message AND the exception message AND the stack trace. [end snip...] ... which is just as easy to get by having the following in some utility class: StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); ex.printStackTrace(pw); return <your own message prepended to> + sw.toString(); =jason
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: distinguishing between failures and errors, neil_swingler |
|---|---|
| Next by Date: | testing web application (jsp) with JavaScript, Vladimir Bilyov |
| Previous by Thread: | Re: OT: Bad examples everywhere (Was: distinguishing between failures and errors), Eric Heikkila |
| Next by Thread: | Re: OT: Bad examples everywhere (Was: distinguishing between failures and errors), Mathieu Gervais |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |