Moar cleanup
[citadel.git] / citadel / citserver.c
index f389ac9f020b303551e62769d12c4d9135ea9b6c..59dc31443f72ec494c2be44c38c4b51a21264402 100644 (file)
  * GNU General Public License for more details.
  */
 
+#include <stdlib.h>
+#include <unistd.h>
 #include <stdio.h>
+#include <sys/stat.h>
 #include "sysdep.h"
 #include <time.h>
 #if HAVE_BACKTRACE
@@ -49,10 +52,12 @@ void cit_backtrace(void)
        size = backtrace(stack_frames, sizeof(stack_frames) / sizeof(void*));
        strings = backtrace_symbols(stack_frames, size);
        for (i = 0; i < size; i++) {
-               if (strings != NULL)
-                       syslog(LOG_ALERT, "%s %s\n", p, strings[i]);
-               else
-                       syslog(LOG_ALERT, "%s %p\n", p, stack_frames[i]);
+               if (strings != NULL) {
+                       syslog(LOG_DEBUG, "citserver: %s %s", p, strings[i]);
+               }
+               else {
+                       syslog(LOG_DEBUG, "citserver: %s %p", p, stack_frames[i]);
+               }
        }
        free(strings);
 #endif
@@ -78,12 +83,13 @@ void cit_oneline_backtrace(void)
                                StrBufAppendPrintf(Buf, "%p : ", stack_frames[i]);
                }
                free(strings);
-               syslog(LOG_ALERT, "%s %s\n", IOSTR, ChrPtr(Buf));
+               syslog(LOG_DEBUG, "citserver: %s %s", IOSTR, ChrPtr(Buf));
                FreeStrBuf(&Buf);
        }
 #endif
 }
 
+
 /*
  * print the actual stack frame.
  */
@@ -98,10 +104,12 @@ void cit_panic_backtrace(int SigNum)
        size = backtrace(stack_frames, sizeof(stack_frames) / sizeof(void*));
        strings = backtrace_symbols(stack_frames, size);
        for (i = 0; i < size; i++) {
-               if (strings != NULL)
-                       syslog(LOG_ALERT, "%s\n", strings[i]);
-               else
-                       syslog(LOG_ALERT, "%p\n", stack_frames[i]);
+               if (strings != NULL) {
+                       syslog(LOG_DEBUG, "%s", strings[i]);
+               }
+               else {
+                       syslog(LOG_DEBUG, "%p", stack_frames[i]);
+               }
        }
        free(strings);
 #endif