
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.