4 ms·
I think he is assuming that the logged exception will include the details needed to track down the error (line number, stack trace)
by jayknight 5y ago
I think he is assuming that the logged exception will include the details needed to track down the error (line number, stack trace)
- adrianmsmith 5y agoOf course in an ideal scenario that's the case. Nevertheless programs do sometimes just "crash" without an error message, or maybe they hang and never produce any output due to an infinite loop, or excessive memory allocation and GC overhead, etc. Logging what the program was attempting to do is useful in those scenarios.
- sagichmal 5y agoYes, it’s useful, but that occasional usefulness is substantially outweighed by it’s perpetual cost.
- bobbyi 5y agoYes. I think logging before is still useful, but it is for hangs, not exceptions. If your program disappears into a black hole doing some operation that doesn't have (and needs) a timeout specified, you want to know what it was about to do when you last heard from it.