Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
doc fix.
[simgrid.git] / src / xbt / log.c
index 8303e17..83ee7ff 100644 (file)
@@ -7,7 +7,9 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+
 #include <stdarg.h>
+#include "gras_config.h" /* to get a workgin stdarg.h */
 #include <ctype.h>
 
 #include "xbt_modinter.h"
@@ -262,10 +264,9 @@ XBT_LOG_NEW_CATEGORY(surf,"All SURF categories");
 XBT_LOG_NEW_CATEGORY(msg,"All MSG categories");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(log,xbt,"Loggings from the logging mechanism itself");
 
-void xbt_log_init(int *argc,char **argv, const char *defaultlog) {
+void xbt_log_init(int *argc,char **argv) {
   int i,j;
   char *opt;
-  int found=0;
 
   /* Set logs and init log submodule */
   for (i=1; i<*argc; i++) {
@@ -273,7 +274,6 @@ void xbt_log_init(int *argc,char **argv, const char *defaultlog) {
        !strncmp(argv[i],"--surf-log=",strlen("--surf-log=")) ||
        !strncmp(argv[i],"--msg-log=",strlen("--msg-log=")) ||
        !strncmp(argv[i],"--xbt-log=",strlen("--xbt-log="))) {
-      found = 1;
       opt=strchr(argv[i],'=');
       opt++;
       xbt_log_control_set(opt);
@@ -287,9 +287,6 @@ void xbt_log_init(int *argc,char **argv, const char *defaultlog) {
       i--; /* compensate effect of next loop incrementation */
     }
   }
-  if (!found && defaultlog) {
-     xbt_log_control_set(defaultlog);
-  }
 }
 
 void xbt_log_exit(void) {
@@ -319,9 +316,9 @@ static void _apply_control(xbt_log_category_t cat) {
       xbt_log_threshold_set(cat, setting->thresh);
       xbt_dynar_cursor_rm(xbt_log_settings,&cursor);
 
-      if (cat->threshold <= xbt_log_priority_verbose) {
+      if (cat->threshold <= xbt_log_priority_debug) {
        s_xbt_log_event_t _log_ev = 
-         {cat,xbt_log_priority_verbose,__FILE__,_XBT_GNUC_FUNCTION,__LINE__};
+         {cat,xbt_log_priority_debug,__FILE__,_XBT_FUNCTION,__LINE__};
        _xbt_log_event_log(&_log_ev,
                 "Apply settings for category '%s': set threshold to %s (=%d)",
                 cat->name, 
@@ -331,7 +328,7 @@ static void _apply_control(xbt_log_category_t cat) {
   }
   if (!found && cat->threshold <= xbt_log_priority_verbose) {
     s_xbt_log_event_t _log_ev = 
-      {cat,xbt_log_priority_verbose,__FILE__,_XBT_GNUC_FUNCTION,__LINE__};
+      {cat,xbt_log_priority_verbose,__FILE__,_XBT_FUNCTION,__LINE__};
     _xbt_log_event_log(&_log_ev,
                        "Category '%s': inherited threshold = %s (=%d)",
                        cat->name,
@@ -546,7 +543,7 @@ static void _cleanup_double_spaces(char *s) {
  * where [category] is one the category names and keyword is one of the
  * following:
  *
- *      thresh         value is an integer priority level. Sets the category's
+ *      thres                  value is an integer priority level. Sets the category's
  *                        threshold priority.
  *
  * \warning