diff options
Diffstat (limited to 'base/logging.hpp')
-rw-r--r-- | base/logging.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/base/logging.hpp b/base/logging.hpp index 163041e0fb..147958938a 100644 --- a/base/logging.hpp +++ b/base/logging.hpp @@ -87,3 +87,11 @@ using ::my::LCRITICAL; if ((level) >= ::my::g_LogLevel) \ ::my::LogMessage(level, my::SrcPoint(), ::my::impl::Message msg); \ } while (false) + +// Conditional log. Logs @msg with level @level in case when @X returns false. +#define CLOG(level, X, msg) \ + do \ + { \ + if (!X) \ + LOG(level, (SRC(), "CLOG(" #X ")", ::my::impl::Message msg)); \ + } while (false) |