Merge branch 'development'
[NeonServV5.git] / src / log.c
index 6e1ba878e04dabe53776ecb35186bbd691a5dc23..44d63df1d6dbad73890dee3cf3e74ba7ab8ff177 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -31,6 +31,9 @@ static void load_log_targets();
 static void unload_log_targets();
 static int reload_log_targets(int init);
 
+#ifdef HAVE_THREADS
+static pthread_mutex_t log_sync;
+#endif
 
 #define LOG_TARGET_TYPE_FILE   1
 #define LOG_TARGET_TYPE_STDOUT 2
@@ -138,7 +141,7 @@ static void write_log(const char *module, const int section, const char *line, i
         if(!(target->section & section))
             continue;
         if(target->type == LOG_TARGET_TYPE_IRC) {
-            if(section == LOG_IRCRAW || (!stricmp(module, "iohandler") && section == LOG_DEBUG))
+            if(section == LOG_IRCRAW || !stricmp(module, "iohandler"))
                 continue; //endless loop ;)
             struct ChanNode *channel = getChanByName(target->target.channel);
             struct ClientSocket *client;
@@ -284,6 +287,9 @@ static IOHANDLER_LOG_BACKEND(log_iohandler_backend) {
 }
 
 void init_log() {
+    #if HAVE_THREADS
+    THREAD_MUTEX_INIT(log_sync);
+    #endif
     load_log_targets();
     bind_reload(reload_log_targets, 0);
     iolog_backend = log_iohandler_backend;