将ReportMemoryLeaksOnShutdown的结果重定向到日志文件 [英] Redirect results from ReportMemoryLeaksOnShutdown to a log file
问题描述
有没有办法将ReportMemoryLeaksOnShutdown的输出重定向到别的地方?例如,将信息打印到文件中?
doco说:
内存管理器将在
内存池关闭时扫描
在消息对话框中报告所有未注册的内存泄漏
。
我正在使用Delphi 2010
下载完整版本来自sourceforge的 FastMM4 。您可以将其配置为写入FastMM4Options.inc中的日志文件;只需在下载中查看自述文件和FAQ文件,了解详细信息。具体来说,查找有关 FullDebugMode
和 LogErrorsToFile
的信息,以及常见问题解答中的第三或第四个问题。
I want to add memory leak detection to our automated Unit tests. ReportMemoryLeaksOnShutdown will detect any memory leaks. The big problem is that it prints the results to a modal dialog box, which has to be closed manually by the user. This does not work in an automated Unit test running on a build server.
Is there any way to redirect the output from ReportMemoryLeaksOnShutdown to somewhere else? For example, print the information to a file?
The doco says:
the Memory Manager will scan the memory pool when it shuts down and report all unregistered memory leaks in a message dialog.
I am using Delphi 2010
Download the full version of FastMM4 from sourceforge. You can configure it to write to a logfile in FastMM4Options.inc; just check the readme and FAQ files in the download for details. Specifically, look for information regarding FullDebugMode
and LogErrorsToFile
, and the third or fourth question in the FAQ readme.
这篇关于将ReportMemoryLeaksOnShutdown的结果重定向到日志文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!