Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix the inclusion paths
[simgrid.git] / src / xbt / log.c
index 8e290e9..fb86a02 100644 (file)
@@ -9,16 +9,12 @@
    under the terms of the license (GNU LGPL) which comes with this package. */
 
 
-#include "Core/core_interface.h"
+#include "gros_interface.h"
 #include "gras_private.h"
 #include <stdarg.h>
 #include <assert.h>
 #include <ctype.h>
 
-#ifndef MIN
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
-
 typedef struct {
   char *catname;
   gras_log_priority_t thresh;
@@ -35,6 +31,7 @@ static void _free_setting(void *s) {
 
 const char *gras_log_priority_names[8] = {
   "NONE",
+  "TRACE",
   "DEBUG",
   "VERBOSE",
   "INFO",
@@ -205,7 +202,7 @@ static gras_error_t _gras_log_parse_setting(const char* control_string,
   gras_assert1(*dot == '.' && *eq == '=',
               "Invalid control string '%s'",control_string);
 
-  if (!strncmp(dot + 1, "thresh", MIN(eq - dot - 1,strlen("thresh")))) {
+  if (!strncmp(dot + 1, "thresh", min(eq - dot - 1,strlen("thresh")))) {
     int i;
     char *neweq=strdup(eq+1);
     char *p=neweq-1;
@@ -217,13 +214,13 @@ static gras_error_t _gras_log_parse_setting(const char* control_string,
     }
     
     DEBUG1("New priority name = %s",neweq);
-    for (i=0; i<6; i++) {
+    for (i=0; i<gras_log_priority_infinite-1; i++) {
       if (!strncmp(gras_log_priority_names[i],neweq,p-eq)) {
        DEBUG1("This is priority %d",i);
        break;
       }
     }
-    if (i<6) {
+    if (i<gras_log_priority_infinite-1) {
       set->thresh=i;
     } else {
       gras_assert1(FALSE,"Unknown priority name: %s",eq+1);
@@ -231,7 +228,7 @@ static gras_error_t _gras_log_parse_setting(const char* control_string,
     free(neweq);
   } else {
     char buff[512];
-    snprintf(buff,MIN(512,eq - dot - 1),"%s",dot+1);
+    snprintf(buff,min(512,eq - dot - 1),"%s",dot+1);
     gras_assert1(FALSE,"Unknown setting of the log category: %s",buff);
   }
   if (!(set->catname=malloc(dot - name+1)))