added new multi log system
[NeonServV5.git] / src / IRCQueue.c
index 296850d076d102cf885bc8a338e9f7ef693882ba..a7cc1a4d00fd52521ba0cc108a3db83c9dbf0d69 100644 (file)
@@ -18,6 +18,7 @@
 #include "ClientSocket.h"
 #include "IOHandler.h"
 #include "tools.h"
+#include "log.h"
 
 #define MAXPENALTY 8 /* 4 messages */
 
@@ -41,7 +42,7 @@ static IOHANDLER_CALLBACK(queue_callback);
 static struct BotQueue *initialize_queue(struct ClientSocket *client) {
     struct BotQueue *queue = malloc(sizeof(*queue));
     if (!queue) {
-        perror("malloc() failed");
+        printf_log("main", LOG_ERROR, "%s:%d malloc() failed", __FILE__, __LINE__);
         return NULL;
     }
     queue->client = client;
@@ -131,7 +132,7 @@ int queue_add(struct ClientSocket *client, char* msg, int len) {
     } else {
         struct QueueEntry *entry = malloc(sizeof(*entry));
         if (!entry) {
-            perror("malloc() failed");
+            printf_log("main", LOG_ERROR, "%s:%d malloc() failed", __FILE__, __LINE__);
             return 0;
         }
         entry->msg = strdup(msg);