Last active
March 26, 2016 14:26
-
-
Save dorgonman/575f2e4a3c78621bcff8 to your computer and use it in GitHub Desktop.
usage_horizon_log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static class HorizonDevNull | |
{ | |
} horizon_dev_null; | |
//BOOST_LOG_FUNCTION() | |
//BOOST_LOG_FUNCTION() | |
#define HORIZON_LOG_FUNCTION " [" << __FILE__ << "(" << __LINE__ << ")" << ": " << BOOST_CURRENT_FUNCTION << "] " | |
#if defined(NDEBUG) || defined(_NDEBUG) | |
template <typename T> | |
HorizonDevNull & operator<<(HorizonDevNull & dest, T) | |
{ | |
return dest; | |
} | |
#define HORIZON_TRACE horizon_dev_null | |
#else | |
#define HORIZON_TRACE BOOST_LOG_TRIVIAL(trace) << HORIZON_LOG_FUNCTION << "\n" | |
#endif | |
#define HORIZON_DEBUG BOOST_LOG_TRIVIAL(debug) << HORIZON_LOG_FUNCTION << "\n" | |
#define HORIZON_INFO BOOST_LOG_TRIVIAL(info) << HORIZON_LOG_FUNCTION << "\n" | |
#define HORIZON_WARNING BOOST_LOG_TRIVIAL(warning) << HORIZON_LOG_FUNCTION << "\n" | |
#define HORIZON_ERROR BOOST_LOG_TRIVIAL(error) << HORIZON_LOG_FUNCTION << "\n" | |
#define HORIZON_FATAL BOOST_LOG_TRIVIAL(fatal) << HORIZON_LOG_FUNCTION << "\n" | |
============================================================== | |
HORIZON_INFO << "HELLO WORLD!!!"; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment