PDA

View Full Version : Capturing Errors in a Delphi Unit


RPOWER
02-Aug-2005, 07:54 PM
I want to use Eurekalog to record the errors localised in a Delphi Unit. I have tried using the ActionNotify, ErrorNotify and OnExceptionNotify but none of them are firing. Does anybody know how to use EurekaLog object for a specific unit?

admin
11-Aug-2005, 09:21 AM
Try to use an ExceptionNotify event like the follow:


uses ExceptionLog, ECore, ETypes; // The required units...

procedure TForm1.EurekaLog1ExceptionNotify(
EurekaExceptionRecord: TEurekaExceptionRecord; var Handled: Boolean);
begin
if (EurekaExceptionRecord.CallStack.Count > 0) then
begin
Handled := (EurekaExceptionRecord.CallStack[0].UnitName = 'Your Unit Name.pas');
end;
end;