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. Each possible option is described in the description of EurekaLog Options dialog.



Option 1

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


{ ... } AExceptionInfo: TEurekaExceptionInfo; { ... }
AExceptionInfo.Options.SaveLogFile := False;



Option 2

Global options are returned by CurrentEurekaLogOptions function from EModules unit:


  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.:


procedure MyExceptionNotifyHandler(const ACustom: Pointer; 
  AExceptionInfo: TEurekaExceptionInfo; 
  var AHandle: Boolean; 
  var ACallNextHandler: Boolean);
  CurrentEurekaLogOptions.SaveLogFile := False; // <- this is wrong!
  AExceptionInfo.Options.SaveLogFile := False;  // <- correct!
  CurrentEurekaLogOptions.SaveLogFile := True; // <- correct!
  AExceptionInfo.Options.SaveLogFile := True;  // <- this is wrong!
  RegisterEventExceptionNotify(nil, MyExceptionNotifyHandler);



See also:

Send feedback... Build date: 2021-10-15
Last edited: 2020-02-10
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: