Root > How to... > ...change EurekaLog's settings at run-time?

...change EurekaLog's settings at run-time?

Previous pageReturn to chapter overviewNext page   

EurekaLog options are represented by TEurekaModuleOptions class from EClasses unit.

 

Note: description of almost every option contains name of corresponding property of TEurekaModuleOptions class. For example:

 

1. "Save bug report to file" (.SaveLogFile) option enables saving...

 

This means that you can change this option at run-time by altering the .SaveLogFile property of TEurekaModuleOptions instance (see below).

 

If there is no mention of corresponding property - this means that:

this option can not be changed at run-time:
ooption affects only compilation - for example, stripping relocation tables, or encrypting injecting debug information;
ooption can not be changed after initial setup - for example, using low-level hooks, or installing memory manager filter to catch leaks;
option is changed by other means (for example, leaks and memory options are changed by routines in EMemLeaks unit; hang detection options are changed by routines in EFreeze unit).

 

 

Option 1

Assuming you have EurekaLog's exception information object (e.g. inside event handler) - you can use the .Options property:

 

procedure MyHandler(const ACustom: Pointer;
  AExceptionInfo: TEurekaExceptionInfo;
  var AHandle: Boolean;
  var ACallNextHandler: Boolean);

 

// ... 
 
AExceptionInfo.Options.SaveLogFile := False;

 

 

Option 2

Global options are returned by the CurrentEurekaLogOptions function from the EModules unit:

 

uses
  EModules; // for CurrentEurekaLogOptions
 
CurrentEurekaLogOptions.SaveLogFile := False;

 

 

Important Note: altering global options will not affect options of already raised exceptions. If you want to change options for a particular exception - obtain EurekaLog's exception information object for that exception and use .Options property (as shown in "option 1" above). E.g.:

 

uses
  EEvents,           // for RegisterEventExceptionNotify
  EException,        // for TEurekaExceptionInfo  
  ETypes,            // for edtNone
  EExceptionManager; // for ExceptionManager
 
procedure DoSomething;
begin
  try
    // your code here
  except
    on E: Exception do
    begin

      // WRONG: Changing global options instead of options for E
      CurrentEurekaLogOptions.ExceptionDialogType := edtNone; // <- this is wrong!

 
      // CORRECT: Changing options for E
      ExceptionManager.Info(E).Options.ExceptionDialogType := edtNone; // <- correct!

      // See also
 
      Application.HandleException(nil); 
    end;
  end;
end;
 
procedure MyExceptionNotifyHandler(const ACustom: Pointer; 
  AExceptionInfo: TEurekaExceptionInfo; 
  var AHandle: Boolean; 
  var ACallNextHandler: Boolean);
begin
  // WRONG: Changing global options instead of current exception's options 
  CurrentEurekaLogOptions.SaveLogFile := False; // <- this is wrong!

 

  // CORRECT: Changing current exception's options 
  AExceptionInfo.Options.SaveLogFile := False;  // <- correct!
end;
 
initialization
  // CORRECT: Changing global options
  CurrentEurekaLogOptions.SaveLogFile := True; // <- correct!

 

  // WRONG: There is no exception here, impossible to change exception's options
  AExceptionInfo.Options.SaveLogFile := True;  // <- this is wrong!
 
  RegisterEventExceptionNotify(nil, MyExceptionNotifyHandler);
end.

 

 

See also:




Send feedback... Build date: 2026-03-31
Last edited: 2026-03-30
PRIVACY STATEMENT
The documentation team uses the feedback submitted to improve the EurekaLog documentation. We do not use your e-mail address for any other purpose. We will remove your e-mail address from our system after the issue you are reporting has been resolved. While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback. After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.


Permanent link to this article: https://www.eurekalog.com/help/eurekalog/how_to_change_settings