How do I send log4cplus appender output to a memory buffer?

不问归期 提交于 2019-12-23 05:52:10

问题


I'm writing a logger that works for both managed and unmanaged code so I'm using log4cplus under the Test Driven Development (TDD) paradigm with Visual Studio 2013 Unmanaged Code Unit Tests under Test Explorer. Trouble is, I can't figure out how to send log4cplus output to the Assert statements.

How do I send log4cplus output to a memory buffer that I can access in the Unit Tests?

If I have to write a customized appender , what would that look like?


回答1:


You would have to create your own appender implementation that does that. To do this, inherit from Appender and implement append().



来源:https://stackoverflow.com/questions/36992430/how-do-i-send-log4cplus-appender-output-to-a-memory-buffer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!