Convenience function CtdlLogResult()
authorArt Cancro <ajc@uncensored.citadel.org>
Mon, 18 Jul 2011 20:19:45 +0000 (16:19 -0400)
committerWilfried Goesgens <dothebart@citadel.org>
Tue, 19 Jul 2011 21:33:53 +0000 (21:33 +0000)
libcitadel/lib/libcitadel.h

index 89fb4cee634561579cb50feb2a21a606ee2acbcf..2df08c23f2212c6baf6511c7f309a4533fbf9acd 100644 (file)
@@ -627,4 +627,7 @@ void WildFireSerializePayload(StrBuf *JsonBuffer, StrBuf *OutBuf, int *MsgCount,
 
 extern ConstStr RoomNetCfgStrs[maxRoomNetCfg];
 
+/* Convenience function to "perform a function and cut a log record if result != 0" */
+#define CtdlLogResult(x) if (x) syslog(LOG_CRIT, "%s:%d %s", __FILE__, __LINE__, strerror(errno))
+
 #endif // LIBCITADEL_H