visual-studiounit-testinglog4cplustest-explorer

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


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?


Solution

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