PROBLEM: I have old code, which is working fine with previous version of EurekaLog (5.x/6.x). It does not work with EurekaLog 7. I set all options as outlined in guides, but EurekaLog is not invoked automatically for exceptions.
I have a threaded application and for some purpose I want to pass call stack information of a catched exception to a new custom exception:
What is the best way to do this, preferably using EurekaLog? I am using Delphi 2006 btw.
Alois Heimer
![Eurekalog 6 Examples Eurekalog 6 Examples](/uploads/1/2/4/9/124997480/384004789.png)
88711 gold badge77 silver badges3535 bronze badges
3 Answers
EurekaLog exposes several event handlers like
OnExceptionNotify
.You can implement these in your code. For example:
procedure EurekaLogExceptionNotify( EurekaExceptionRecord: TEurekaExceptionRecord; var Handled: Boolean);
Here you can see a
TEurekaExceptionRecord
which is defined in ExceptionLog.pas
. But you maybe just own the non-source version which works just fine.The record has a
EurekaExceptionRecord.CallStack
list. This proprietary list can be converted to TStrings
using the CallStackToStrings
method which is also defined in the ExceptionLog
unit.Here is an example where I write the CallStack into a StringList.
At least from this starting point you should be able to investigate the exposed functions, records etc.. All information is accessible.
Erik VirtelErik Virtel63522 gold badges88 silver badges2626 bronze badges
EurekaLog provides a function
GetLastExceptionCallStack()
(defined in unit ExceptionLog.pas
). Using this I have written the following function (based on example code here):So you can write:
yonojoyyonojoy4,63411 gold badge2323 silver badges5050 bronze badges
EurekaLog 7 has Chained Exception support, which is specifically designed for this task. Just enable it in options (it is enabled by default) and use:
AlexAlex4,52122 gold badges2626 silver badges4848 bronze badges
![Women Women](/uploads/1/2/4/9/124997480/435516524.png)