PDA

View Full Version : Silent mode & Enable/disable run-time


Khan
28-Apr-2009, 09:10 PM
Hi,

Do you have a silent mode? This should work like:

If any exception happens:

1. post data to web (or email),
2. do not show any dialog box,
3. continue next line

Another question is "Is it possible to enable disable EL runtime?"

Thanks,

Marius
28-Apr-2009, 09:58 PM
1. post data to web (or email),
2. do not show any dialog box,

ExceptionDialogType := edtNone;

3. continue next line

Dont think that is save as the same exception is likely to happen
again.
There is however a continue option which you can use.

Another question is "Is it possible to enable disable EL runtime?"

SetEurekaLogState(true/false);

Thanks,

Thats possible.. The following is something i use within a windows service.

procedure EurekaIgnoreException(AExceptClass: string);
var EExceptionFilter: PEurekaExceptionFilter;
begin
New(EExceptionFilter);
with EExceptionFilter^ do begin Active := True;
ExceptionClassName := AExceptClass;
ExceptionMessage := ''; // Leave the original exception message!
ExceptionType := fetUnhandled; // Catch every UNHANDLED exception.
DialogType := fdtMSClassic; // Show the MS dialog type HandlerType := fhtNone; //fhtEurekaLog; // This exception is NOT handled ActionType := fatNone; // No addictional action is required.
end;
CurrentEurekaLogOptions.ExceptionsFilters.Add(EExc eptionFilter);
end;


procedure InitEurekaLog;
begin
SetEurekaLogState(true);
CurrentEurekaLogOptions.ErrorsNumberToSave := Maxint;
CurrentEurekaLogOptions.ExceptionDialogType := edtNone;
CurrentEurekaLogOptions.OutputPath := ExtractFilePath(ParamStr(0)) + 'Lms' + VersionRecord.FileVersion + '.Elf';
EurekaIgnoreException('EIdException');
EurekaIgnoreException('EIdSilentException');
EurekaIgnoreException('EIdConnClosedGracefully');
end;


begin
InitEurekaLog;

Greetings,
Marius

Khan
28-Apr-2009, 10:22 PM
Dear Marius,

sounds good. So we can enable/disable during runtime. And we can disable exception dialog but we still send report? Are you 100% sure on that?

Bests,

Marius
29-Apr-2009, 06:58 AM
Khan wrote:


Dear Marius,

sounds good. So we can enable/disable during runtime. And we can
disable exception dialog but we still send report? Are you 100% sure
on that?

Bests,

Positive, even my log my log files tell me it it possible :)

Alex
29-Apr-2009, 08:13 AM
Hi, Khan.

Do not forget that you may/should test your settings before deploying application - just place a TButton and write such code:

procedure TForm1.Button1Click(Sender: TObject);
begin
raise Exception.Create('This is a test exception.');
end;

Or (if do not have a form) place this "raise" to any code block, that is certanly executed in your app.

That way you'll be able to check, how your code works, and see if it is suitable for you.

BTW, there is alternative approach - to use event handlers. An example is here: http://support.eurekalog.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=12&nav=0,6

Khan
29-Apr-2009, 02:14 PM
Thanks so much. I have purschased!