Moved to syslog for the dispense log
[tpg/opendispense2.git] / src / server / logging.c
index ac1e603..d7313c9 100644 (file)
@@ -7,6 +7,7 @@
 #include <stdio.h>
 #include <stdarg.h>
 #include "common.h"
+#include <syslog.h>
 
 // === CODE ==
 void Log_Error(const char *Format, ...)
@@ -14,9 +15,7 @@ void Log_Error(const char *Format, ...)
        va_list args;
 
        va_start(args, Format);
-       fprintf(stderr, "Error: ");
-       vfprintf(stderr, Format, args);
-       fprintf(stderr, "\n");
+       vsyslog(LOG_WARNING, Format, args);
        va_end(args);
 }
 
@@ -25,9 +24,7 @@ void Log_Info(const char *Format, ...)
        va_list args;
        
        va_start(args, Format);
-       printf("Info : ");
-       vprintf(Format, args);
-       printf("\n");
+       vsyslog(LOG_INFO, Format, args);
        va_end(args);
 }
 

UCC git Repository :: git.ucc.asn.au