Add framework for enabling (debug) logging per module
[citadel.git] / citadel / server_main.c
index bab3ab69f29bc960da866d43e7c5cfd5a1417825..0dc52a0e4667cd6d320be7f7562cfbf4615bd66a 100644 (file)
@@ -100,6 +100,7 @@ int main(int argc, char **argv)
        char relhome[PATH_MAX]="";
        char ctdldir[PATH_MAX]=CTDLDIR;
        int syslog_facility = LOG_DAEMON;
+       const char *eDebuglist[] = {NULL, NULL};
 #ifdef HAVE_RUN_DIR
        struct stat filestats;
 #endif
@@ -136,7 +137,8 @@ int main(int argc, char **argv)
                        home=1;
                        break;
 
-               case 'x':       /* deprecated */
+               case 'x':
+                       eDebuglist [0] = optarg;
                        break;
 
                case 't':       /* deprecated */
@@ -314,6 +316,9 @@ int main(int argc, char **argv)
        
        initialise_modules(0);
 
+       eDebuglist[1] = getenv("CITADEL_LOGDEBUG");
+       CtdlSetDebugLogFacilities(eDebuglist, 2);
+
        /*
         * If we need host auth, start our chkpwd daemon.
         */