]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/util/logger.c
Merge branch 'sendfile' into develop
[netatalk.git] / libatalk / util / logger.c
index c1e981dd417d5bf8473a1764ad2cef98c1802291..a7cdd2c12a402ecd8bd8d89a199ff4dd92b4cce2 100644 (file)
@@ -90,16 +90,20 @@ UAM_MODULE_EXPORT logtype_conf_t type_configs[logtype_end_of_list_marker] = {
     DEFAULT_LOG_CONFIG /* logtype_uams */
 };
 
+static void syslog_setup(int loglevel, enum logtypes logtype, int display_options, int facility);
+
 /* We use this in order to track the last n log messages in order to prevent flooding */
 #define LOG_FLOODING_MINCOUNT 5 /* this controls after how many consecutive messages must be detected
                                    before we start to hide them */
 #define LOG_FLOODING_MAXCOUNT 1000 /* this controls after how many consecutive messages we force a 
                                       "repeated x times" message */
 #define LOG_FLOODING_ARRAY_SIZE 3 /* this contols how many messages in flow we track */
+
 struct log_flood_entry {
     int count;
     unsigned int hash;
 };
+
 static struct log_flood_entry log_flood_array[LOG_FLOODING_ARRAY_SIZE];
 static int log_flood_entries;
 
@@ -623,24 +627,29 @@ void setuplog(const char *logstr, const char *logfile)
 
     save = ptr = strdup(logstr);
 
-    while (*ptr) {
-        while (*ptr && isspace(*ptr))
-            ptr++;
+    ptr = strtok(ptr, ", ");
 
-        logtype = ptr;
-        ptr = strpbrk(ptr, ":");
-        if (!ptr)
-            break;
-        *ptr = 0;
+    while (ptr) {
+        while (*ptr) {
+            while (*ptr && isspace(*ptr))
+                ptr++;
+
+            logtype = ptr;
+            ptr = strpbrk(ptr, ":");
+            if (!ptr)
+                break;
+            *ptr = 0;
 
-        ptr++;
-        loglevel = ptr;
-        while (*ptr && !isspace(*ptr))
             ptr++;
-        c = *ptr;
-        *ptr = 0;
-        setuplog_internal(loglevel, logtype, filename);
-        *ptr = c;
+            loglevel = ptr;
+            while (*ptr && !isspace(*ptr))
+                ptr++;
+            c = *ptr;
+            *ptr = 0;
+            setuplog_internal(loglevel, logtype, logfile);
+            *ptr = c;
+        }
+        ptr = strtok(NULL, ", ");
     }
 
     free(save);