summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2013-04-08 17:23:59 (GMT)
committerRemko Tronçon <git@el-tramo.be>2013-04-08 17:34:22 (GMT)
commit7d9c895ba6f1cdb56925a5313b989ecb2c5217fa (patch)
tree2864f22142d74c67ed43dce7b40a174297e72060 /Swiften
parent9eff25182d1bea576d1910200909384ce79d90fe (diff)
downloadswift-7d9c895ba6f1cdb56925a5313b989ecb2c5217fa.zip
swift-7d9c895ba6f1cdb56925a5313b989ecb2c5217fa.tar.bz2
SWIFT_LOG_ASSERT macro.
Change-Id: Id0dd8c566855e404b4e14c090e9e259d054ef34f
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/Base/Log.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Swiften/Base/Log.h b/Swiften/Base/Log.h
index f8d524b..a46860f 100644
--- a/Swiften/Base/Log.h
+++ b/Swiften/Base/Log.h
@@ -38,3 +38,7 @@ namespace Swift {
#define SWIFT_LOG(severity) \
if (Log::severity > Log::getLogLevel()) ; \
else Log().getStream(Log::severity, #severity, __FILE__, __LINE__, __FUNCTION__)
+
+#define SWIFT_LOG_ASSERT(test, severity) \
+ if (Log::severity > Log::getLogLevel() || (test)) ; \
+ else Log().getStream(Log::severity, #severity, __FILE__, __LINE__, __FUNCTION__) << "Assertion failed: " << #test << ". "