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

index e9ae975f75935487dd8a867b78b03af95810a7c8..26fd283da0c41c0d5a7d7acd1b7823bf5f874739 100644 (file)
@@ -555,4 +555,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