View Full Version : How to disable eureka in code?
Lasse
19-Nov-2005, 02:44 PM
Hi, I want to disable eurekalog in code when I dont want any logs for a
certain error?
Thanks
Lasse
Joćo Victor
21-Nov-2005, 08:57 AM
Lasse escreveu:
> Hi, I want to disable eurekalog in code when I dont want any logs for a
> certain error?
>
> Thanks
> Lasse
>
>
I use. =/
procedure TForm1.EurekaLogExceptionNotify(
EurekaExceptionRecord: TEurekaExceptionRecord; var Handled: Boolean);
begin
if DebugHook <> 0 Then
Handled := false
else
Handled := true;
end;
admin
21-Nov-2005, 09:28 AM
Hi,
Lasse wrote:
> Hi, I want to disable eurekalog in code when I dont want any logs for a
> certain error?
>
> Thanks
> Lasse
I suggest to use an OnExceptionNotify event like the following:
//----------------------------------------------------------------------
uses
ExceptionLog;
procedure TForm1.EurekaLog1ExceptionNotify(
EurekaExceptionRecord: TEurekaExceptionRecord; var Handled: Boolean);
begin
Handled := not (EurekaExceptionRecord.ExceptionObject is EMyException);
end;
//----------------------------------------------------------------------
So only exceptions not inherited by EMyException will be handled by
EurekaLog.
I hope to have answered to your question! :)
--
Best regards...
Fabio Dell'Aria.
----------------
http://www.eurekalog.com
Catch every BUG showing line n.
Lasse
28-Nov-2005, 12:44 PM
Hi,
If I use this my program become slow.
Question: is this a method or normal procedure? where should I put it, in
main form? or must I use the component?
Thanks
Lasse
"admin" <support@eurekalog.com> skrev i meddelandet
news:dls7dt$p8e$1@plesk.eurekalog.com...
> Hi,
>
> Lasse wrote:
>> Hi, I want to disable eurekalog in code when I dont want any logs for a
>> certain error?
>>
>> Thanks
>> Lasse
>
> I suggest to use an OnExceptionNotify event like the following:
>
>
> //----------------------------------------------------------------------
>
> uses
> ExceptionLog;
>
> procedure TForm1.EurekaLog1ExceptionNotify(
> EurekaExceptionRecord: TEurekaExceptionRecord; var Handled: Boolean);
> begin
> Handled := not (EurekaExceptionRecord.ExceptionObject is EMyException);
> end;
>
> //----------------------------------------------------------------------
>
>
> So only exceptions not inherited by EMyException will be handled by
> EurekaLog.
>
> I hope to have answered to your question! :)
>
> --
> Best regards...
>
> Fabio Dell'Aria.
> ----------------
> http://www.eurekalog.com
> Catch every BUG showing line n.
admin
28-Nov-2005, 01:18 PM
Hi,
Lasse wrote:
> Hi,
> If I use this my program become slow.
> Question: is this a method or normal procedure? where should I put it, in
> main form? or must I use the component?
>
> Thanks
> Lasse
>
> [...]
You can use it an Method or procedure.
I suggest you to put it in the first unit or form initialized in your
project.
If your project is too slow then I think you do a massive use of exceptions.
--
Best regards...
Fabio Dell'Aria.
----------------
http://www.eurekalog.com
Catch every BUG showing line n.
vBulletin® v3.8.2, Copyright ©2000-2010, Jelsoft Enterprises Ltd.