Root > How to... > ...get file name for the bug report?

...get file name for the bug report?

Previous pageReturn to chapter overviewNext page   

Option 1

Use OnCustomFileName event handler:

 

uses
  EEvents;
 
procedure ControlNames(const ACustom: Pointer; AExceptionInfo: TEurekaExceptionInfo; const AFileType: TEurekaLogFileType; var AFileName: Stringvar ACallNextHandler: Boolean);
var
  BugReportFileName: String;

begin
  // ftSavedBugReport indicate bug report
  // you can also use other values
  if AFileType = ftSavedBugReport then
  begin
    BugReportFileName := AFileName;
    // you can also change file name (AFileName) here
  end;
end;
 
initialization
  RegisterEventCustomFileName(nil, ControlNames);
end.

 

 

Option 2

Assuming you have EurekaLog's information object (e.g. event handler):

 

{ ... } AExceptionInfo: TEurekaExceptionInfo; { ... }
var
  BugReportFileName: String;
begin
  BugReportFileName := AExceptionInfo.ExpandEnvVars(AExceptionInfo.Options.OutputLogFile(''));
end;

 

This will give you a default file name as set in your options, ignoring any run-time customizations set by OnCustomFileName event handlers, dialogs, etc.

 

 

Option 3

Only as last resort measure - use global settings:

 

uses
  EModules; // for CurrentEurekaLogOptions
 
BugReportFileName := CurrentEurekaLogOptions.ExpandEnvVars(CurrentEurekaLogOptions.OutputLogFile(''));

 

Note: be aware, that global code can not expand some variables (such as %BugID% - because those does not exist outside of exception processing code).

 

 

See also:




Send feedback... Build date: 2024-09-30
Last edited: 2023-08-09
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_get_file_name_for_bug_report.php