[BOOST] [TEST] Dumping the memory leak into Log File

Hi All, Memory leak information is displayed onto the console window but I want to write the memory leak information in the log file I am creating? Could you please let me know how can I achieve this? Thanks Suraj DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. -----------------------------------------------------------------------------------------------------------------------

Suraj Gupta, Gurgaon wrote:
Hi All,
Memory leak information is displayed onto the console window but I want to write the memory leak information in the log file I am creating? Could you please let me know how can I achieve this?
I believe your only option at the moment is to redirect standard output/error streams. Boost.Test used functionality provided by MS runtime and has very little configuration power over it. Gennadiy

On Sat, Jun 6, 2009 at 1:52 AM, Gennadiy Rozental
Suraj Gupta, Gurgaon wrote:
Hi All,
Memory leak information is displayed onto the console window but I want to write the memory leak information in the log file I am creating? Could you please let me know how can I achieve this?
I believe your only option at the moment is to redirect standard output/error streams. Boost.Test used functionality provided by MS runtime and has very little configuration power over it.
Gennadiy
I haven't taken a look at the Boost.Test memory leak info code yet so forgive me if I'm speaking out of context, but since you mention MS runtime I assume you're referring to the _CrtDebug functions. Take a look at _CrtSetDbgFlag with option _CRTDBG_MODE_FILE and another function _CrtSetReportFile. If you want to support multiple output streams, you might be able to use a handle to a named pipe in _CrtSetReportFile and then monitor the named pipe yourself and multiplex it. This doesn't help the original poster very much, but might help enhancing the library.
participants (3)
-
Gennadiy Rozental
-
Suraj Gupta, Gurgaon
-
Zachary Turner