By angsuman
via blog.taragana.com
Published: Sep 15 2008 / 04:44
A simple but invaluable java function for debugging.
![]() | |
| HTML5 Canvas | |
| Written by: Simon Sarris | |
| Featured Refcardz: Top Refcardz: | |
| 150+ Refcardz Available · Get them all | |
By angsuman
via blog.taragana.com
Published: Sep 15 2008 / 04:44
Comments
bloid replied ago:
ahhh...this old chestnut...
jtheory replied ago:
Well, it's core Java.
But how come they aren't throwing an exception, catching it, writing the stack trace to a StringWriter, then parsing it for the line number? I thought that was the "classic" approach.
bloid replied ago:
It is? I'd never heard of that one... Always build a stacktrace array, and look for the relevant item...
gareth_western replied ago:
or you could use one of the well-established logging libraries, such as Log4J
angsuman replied ago:
I like something simple. Log4J, unfortunately, is not simple.
,> But how come they aren't throwing an exception, catching it, writing the stack trace to a StringWriter, then parsing it for the line number?
None of them throws any exception. Try it out.
Voters For This Link (14)
Voters Against This Link (2)