* Use syslog-compatible logging levels in lprintf(); the loglevel chosen
[citadel.git] / citadel / sysdep_decls.h
index 37ee0769fa1c53b14d501e4b9198fed5765a5c70..a83c14816f7e5f5ec3fac172b3246e18c3578990 100644 (file)
@@ -4,11 +4,31 @@
 #include "sysdep.h"
 #include "server.h"
 
+/* Logging levels - correspond to syslog(3) */
+enum LogLevel {
+       /* When about to exit the server for an unrecoverable error */
+        CTDL_EMERG,    /* system is unusable */
+       /* Manual intervention is required to avoid an abnormal exit */
+        CTDL_ALERT,    /* action must be taken immediately */
+       /* The server can continue to run with degraded functionality */
+        CTDL_CRIT,     /* critical conditions */
+       /* An error occurs but the server continues to run normally */
+        CTDL_ERR,      /* error conditions */
+       /* An abnormal condition was detected; server will continue normally */
+        CTDL_WARNING,  /* warning conditions */
+       /* Normal messages (login/out, activity, etc.) */
+        CTDL_NOTICE,   /* normal but significant condition */
+       /* Unimportant progress messages, etc. */
+        CTDL_INFO,     /* informational */
+       /* Debugging messages */
+        CTDL_DEBUG,    /* debug-level messages */
+};
+
 #ifdef __GNUC__
-void lprintf (int loglevel, const char *format, ...) __attribute__((__format__(__printf__,2,3)));
+void lprintf (enum LogLevel loglevel, const char *format, ...) __attribute__((__format__(__printf__,2,3)));
 void cprintf (const char *format, ...) __attribute__((__format__(__printf__,1,2)));
 #else
-void lprintf (int loglevel, const char *format, ...);
+void lprintf (enum LogLevel loglevel, const char *format, ...);
 void cprintf (const char *format, ...);
 #endif
 
@@ -50,6 +70,5 @@ extern struct worker_node {
         struct worker_node *next;
 } *worker_list;
 
-
 extern int SyslogFacility(char *name);
 extern int syslog_facility;