LOGGING: make context logging configurabel. (joining user & context)
[citadel.git] / citadel / context.h
index 08de75bb336a3b8d4b18161727c06cccbcdda53d..9d158f469e5ae27355fcb99e540d6499dbf25db7 100644 (file)
@@ -195,4 +195,19 @@ static INLINE void become_session(CitContext *which_con) {
 }
 
 
+
+typedef void (*CtdlDbgFunction) (const int);
+
+extern int DebugSession;
+#define CONDBGLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (DebugSession != 0))
+
+#define CON_syslog(LEVEL, FORMAT, ...)                         \
+       CONDBGLOG(LEVEL) syslog(LEVEL,                          \
+                               "Context: " FORMAT, __VA_ARGS__)
+
+#define CONM_syslog(LEVEL, FORMAT)                     \
+       CONDBGLOG(LEVEL) syslog(LEVEL,                  \
+                               "Context: " FORMAT);
+
+
 #endif /* CONTEXT_H */