Reputation: 373
I'd like to add a record of all clicks made whenever EurekaLog creates a .el file. For this, I'd need a callback from EurekaLog whenever it catches an exception, so I can dump all recorded clicks into my own log file. Does EurekaLog provide a way to do that ?
I'm using Delphi 10.3 and EurekaLog 7.7.8.
Edit : Brian pointed out the EurekaLog callbacks, which are exactly what I need. Unfortunately I cannot manage to register them properly, I always get the "E2250 There is no overloaded version of 'RegisterEventReproduceRequest' that can be called with these arguments" error. Here are samples of the different formattings I've tried :
procedure OkTestThis(const ACustom: Pointer; AExceptionInfo: TEurekaExceptionInfo; var AReproduceText: String; var ACallNextHandler: Boolean);
procedure OkTestThisOther(AExceptionInfo: TEurekaExceptionInfo; var AReproduceText: String; var ACallNextHandler: Boolean);
TWhat = class
procedure what1(const ACustom: Pointer; AExceptionInfo: TEurekaExceptionInfo; var AReproduceText: String; var ACallNextHandler: Boolean);
procedure what2(AExceptionInfo: TEurekaExceptionInfo; var AReproduceText: String; var ACallNextHandler: Boolean);
end;
I also tried using anonymous functions. How do I need to format this callback for Delphi to be ok with it ?
Edit again : Actually, the what2
solution does work. I had so many different possibilities I miscounted the number of error messages...
Upvotes: 0
Views: 107
Reputation: 5668
I have a feeling you are asking a wrong question. Looks like you are trying to do some sort of "steps to reproduce" behaviour. If that is the case - why do you want to dump logging info into standalone file? It does not make any sense.
What you should do is include/bundle this info into bug report about exception. If you are OK with that - see "How to add custom information to a bug report?" in EurekaLog's How-tos.
If you still want to dump your info into a standalone file - well, there are events for that, such as:
OnExceptionNotify
- called when EurekaLog handles an exceptionOnBeginReportGen
- called when bug report is about to be createdP.S. Regarding the "E2250 There is no overloaded version of 'RegisterEventReproduceRequest' that can be called with these arguments" error - different versions of EurekaLog may have slightly different arguments for events. So if you are looking at sample code for latest version and try to use it "as is" in older version of EurekaLog - this may not work.
The easiest way to fix this is to drop TEurekaLogEvents
component on the form and register event from there. Proper arguments will be automatically generated by the IDE. Please note: using component for registering event handlers has some limitations.
Another way is to open EEvents.pas
unit and look at event's declaration. For example:
TELEvReproduceRequestProc = procedure(const ACustom: Pointer; AExceptionInfo: TEurekaExceptionInfo; var AReproduceText: String; var ACallNextHandler: Boolean);
Upvotes: 0