Skip to content

Instantly share code, notes, and snippets.

@yashihei
Last active May 6, 2017 00:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yashihei/9927672e2eecf776a368ab25cbe2e6b4 to your computer and use it in GitHub Desktop.
Save yashihei/9927672e2eecf776a368ab25cbe2e6b4 to your computer and use it in GitHub Desktop.
#include <winbase.h>
#include <boost/format.hpp>
inline void Log(boost::format &bfmt) {
#if defined(_DEBUG)
OutputDebugString(bfmt.str().c_str());
#endif
}
template<class First, class... Rest>
inline void Log(boost::format &bfmt, const First& first, const Rest&... rest) {
Log(bfmt % first, rest...);
}
template<class... Rest>
inline void Log(const std::string& fmt, const Rest&... rest) {
boost::format bfmt(fmt);
Log(bfmt, rest...);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment