Attach dynamically a log file to the email bug report

delphi package - automated exception handling

Attach dynamically a log file to the email bug report

Postby geekobi » Tue Mar 28, 2017 8:22 am

Hi,
I'm trying to add an attached file to the emailed bug reports.
The attachment must be done programmatically and not by the properties settings because the name of the file depends on the connected user name.

In the madexcept help, I found :
// Examples:
MESettings.AdditionalAttachments.Add('c:\boot.ini');
exceptIntf.AdditionalAttachments.Add(ParamStr(0), '', 'crashingExe.zip');

And it doesn't work, so I digged into the issue and :
- I found the use clause for the MESettings object : "use madexcept" is ok,
- but I found no use clause for the exceptIntf object
- I found no reference to the 'AdditionalAttachments' word into the demos provided with madcollection,
- I found 2 references to 'exceptInt', but they were parameters of a function, so it was not usefull in my case

So I don't know what to do further
If anybody can help or has a sample code, I thanks him in advance.
My current language is Delphi 6.
geekobi
 
Posts: 4
Joined: Wed Mar 22, 2017 3:08 pm

Re: Attach dynamically a log file to the email bug report

Postby madshi » Tue Mar 28, 2017 1:37 pm

Additional attachments need to be added in an exception handler. See "RegisterExceptionHandler()". I'd suggest "stDontSync" and "epMainPhase" parameters. Your exception handler then receives an "exceptIntf" parameter which you can use to call "exceptIntf.AdditionalAttachments.Add(...)".
madshi
Site Admin
 
Posts: 9275
Joined: Sun Mar 21, 2004 5:25 pm

Re: Attach dynamically a log file to the email bug report

Postby geekobi » Wed Mar 29, 2017 10:35 am

Thanks for madshi answer,
Finally, I used this and it worked (I got the log file attached in the email bug report) :

Code: Select all
uses madExcept;
MESettings.AdditionalAttachments.Add(log_filename);

I continue my tests because of madshi answer which is different and I will let you informed if I got issues with mine.
geekobi
 
Posts: 4
Joined: Wed Mar 22, 2017 3:08 pm


Return to madExcept

Who is online

Users browsing this forum: No registered users and 2 guests