zaphire/Monocle-Engine — pull request #109 by etinquis (2012-01-03 08:26:45+00:00)
Title: Cleaner Log Output interface

Additional output options can now be added easier. One call can be used to set multiple output locations. There is no longer a need to check class-level bools in every Debug::Log function, the streams are handled by the new DebugOutStream class.

--Debug::SetLogDestination(OutputDestFlags, const string&) added.
This can be used to set multiple output locations, eg
Debug::SetLogDestination(Debug::LOG_FILE | Debug::LOG_COUT,
"myLog.log");
The string argument is the filename if LOG_FILE flag is set.
--DebugOutStream class added, allowing all Debug::Log functions to simply call DebugOutStream << logArg << std::endl; without caring about what streams actually have to be written to. DebugOutStream manages the
ostreams and the destination flags.