In article <***@newsgroups.borland.com>, ***@Hotmail.com
says...
Post by Lauchlan MPost by G. Bradley MacDonaldAll three are good products. I have used madExcept and Exception Magic.
I have not used Eurekalog as it does not support logging of handled
exceptions (the other two do).
Ah. I had to think about that. _Handled_ exceptions.
How would you make MadExcept log handled exceptions as well as unhandled
ones, and . . .
Lauchlan - I would be happend to send you a unit I use to manage this -
but basically it is as follows
To Start logging Handled Exceptions
RegisterHiddenExceptionHandler
(TAExceptionHanlder.MadException_HiddenExceptionHandler, False);
To Stop logging Handled Exceptions
UnRegisterHiddenExceptionHandler
(TAExceptionHanlder.MadException_HiddenExceptionHandler);
then in the above handler you need the following line - where I create
the Header and AddtionalInfo for the hanndled exceptions.
AutoSaveBugReport(FHeader + AdditionalInfo + bugReport + #10#13 + #10#
13 + TASystemController.GenerateSystemInfoText);
Let me know - I would be happy to provide you with the code from the
unit I took the above snippets from!
Post by Lauchlan MWhy would you want to do it in MadExcept/EurekaLog?
Generally my strategy is to get ME or EL to capture the unhandled exceptions
(something I didn't anticipate) and email me a bug report, and to deal with
the handled exceptions internally in the app. So handled exceptions are
usually not 'problems' (although in some cases they certainly could be and
you'd want to log them, but perhaps in a different log file to the unhandled
exceptions log?).
It has been my experience that handled exceptions can indicate a problem
just as Unhandled ones - especially when dealing with other peoples code
<g> such as components, etc.
Basically because I can get the line numbers from the Exception Handling
components - I find it to be an incrediably useful remote problem
solving tools (as from the sounds of things - so do you). However, I
have encountered issues where some exceptions have not been handled
properly and have caused issues further down/up the stack.
For example: Routine A calls Routine B. Routine B has an exception
that is trapped in a generic Try..Except..End block. However, perhaps
that routine needs to set a value or return a value and it is not then
doing so properly (but only under some circumstances). Routine A then
gets the value and then raises and exception (which is not handled).
Without the ability to log "Handled" exceptions my report would only
point me to routine A - and not show me right where in Routine B the
"Real" problem occurred.
However, it is important to be to turn it off/on. If it was on all the
time it would slow things down and create huge log files <g>. So - with
both Exception Magic and madExcept - you can turn it on/off with a
simple call. In my case I have a check box in the application
preferences form that allows the user to do this. This capability has
saved me countless hours trying to troubleshoot problems on remote
customer machines.
I originally came across this feature in ExceptionMagic - then I
mentioned it to the author of MadExcept - who added it. I find it to be
very useful.
As I said above - if you want my controlling class to look at how you
turn on-off this feature in madExcept - let me know and I will make it
available.
Bradley