Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'base/logging.hpp')
-rw-r--r--base/logging.hpp8
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)