Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
__FUNCTION__ is now in the standard
[simgrid.git] / src / xbt / log.c
index 28e2506..d0577f8 100644 (file)
@@ -1,6 +1,6 @@
 /* log - a generic logging facility in the spirit of log4j                  */
 
-/* Copyright (c) 2004-2014. The SimGrid Team.
+/* Copyright (c) 2004-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 #include <stdio.h>              /* snprintf */
 #include <stdlib.h>             /* snprintf */
 
-#include "portable.h"           /* to get a working stdarg.h */
+#include "src/internal_config.h"
 
-#include "xbt_modinter.h"
+#include "src/xbt_modinter.h"
 
 #include "xbt/misc.h"
 #include "xbt/ex.h"
 #include "xbt/str.h"
 #include "xbt/sysdep.h"
-#include "xbt/log_private.h"
+#include "src/xbt/log_private.h"
 #include "xbt/dynar.h"
 #include "xbt/xbt_os_thread.h"
 
 int xbt_log_no_loc = 0;         /* if set to true (with --log=no_loc), file localization will be omitted (for tesh tests) */
-static xbt_os_rmutex_t log_cat_init_mutex = NULL;
+static xbt_os_mutex_t log_cat_init_mutex = NULL;
 
 /** \addtogroup XBT_log
  *
@@ -359,7 +359,6 @@ Here are the existing format directives:
  - %%l: location where the log event was raised (LOG4J compatible, like '%%F:%%L' -- this is a l as in 'l'etter)
  - %%L: line number where the log event was raised (LOG4J compatible)
  - %%M: function name (LOG4J compatible -- called method name here of course).
-   Defined only when using gcc because there is no __FUNCTION__ elsewhere.
 
  - %%b: full backtrace (Called %%throwable in LOG4J).
    Defined only under windows or when using the GNU libc because backtrace() is not defined
@@ -477,8 +476,7 @@ Each category has an optional appender. An appender is a pointer to a
 structure which starts with a pointer to a do_append() function. do_append()
 prints a message to a log.
 
-When a category is passed a message by one of the logging macros, the
-category performs the following actions:
+When a category is passed a message by one of the logging macros, the category performs the following actions:
 
   - if the category has an appender, the message is passed to the
     appender's do_append() function,
@@ -518,8 +516,7 @@ static void _free_setting(void *s)
   }
 }
 
-static void _xbt_log_cat_apply_set(xbt_log_category_t category,
-                                   xbt_log_setting_t setting);
+static void _xbt_log_cat_apply_set(xbt_log_category_t category, xbt_log_setting_t setting);
 
 const char *xbt_log_priority_names[8] = {
   "NONE",
@@ -541,8 +538,7 @@ s_xbt_log_category_t _XBT_LOGV(XBT_LOG_ROOT_CAT) = {
       0                         /* additivity */
 };
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(log, xbt,
-                                "Loggings from the logging mechanism itself");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(log, xbt, "Loggings from the logging mechanism itself");
 
 /* create the default appender and install it in the root category,
    which were already created (damnit. Too slow little beetle) */
@@ -552,7 +548,7 @@ void xbt_log_preinit(void)
   xbt_log_default_layout = xbt_log_layout_simple_new(NULL);
   _XBT_LOGV(XBT_LOG_ROOT_CAT).appender = xbt_log_default_appender;
   _XBT_LOGV(XBT_LOG_ROOT_CAT).layout = xbt_log_default_layout;
-  log_cat_init_mutex = xbt_os_rmutex_init();
+  log_cat_init_mutex = xbt_os_mutex_init();
 }
 
 static void xbt_log_connect_categories(void)
@@ -562,19 +558,14 @@ static void xbt_log_connect_categories(void)
 
   /* xbt */
   XBT_LOG_CONNECT(xbt);
-  XBT_LOG_CONNECT(graphxml_parse);
   XBT_LOG_CONNECT(log);
   XBT_LOG_CONNECT(module);
-  XBT_LOG_CONNECT(peer);
   XBT_LOG_CONNECT(replay);
   XBT_LOG_CONNECT(strbuff);
   XBT_LOG_CONNECT(xbt_cfg);
   XBT_LOG_CONNECT(xbt_dict);
   XBT_LOG_CONNECT(xbt_dict_cursor);
   XBT_LOG_CONNECT(xbt_dict_elm);
-#ifdef XBT_USE_DEPRECATED
-  XBT_LOG_CONNECT(xbt_dict_multi);
-#endif
   XBT_LOG_CONNECT(xbt_dyn);
   XBT_LOG_CONNECT(xbt_ex);
   XBT_LOG_CONNECT(xbt_fifo);
@@ -584,8 +575,6 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(xbt_mallocator);
   XBT_LOG_CONNECT(xbt_matrix);
   XBT_LOG_CONNECT(xbt_parmap);
-  XBT_LOG_CONNECT(xbt_queue);
-  XBT_LOG_CONNECT(xbt_set);
   XBT_LOG_CONNECT(xbt_sync);
   XBT_LOG_CONNECT(xbt_sync_os);
 
@@ -593,16 +582,11 @@ static void xbt_log_connect_categories(void)
   /* The following categories are only defined in libsimgrid */
 
   /* bindings */
-#ifdef HAVE_LUA
-  XBT_LOG_CONNECT(bindings);
+#if HAVE_LUA
   XBT_LOG_CONNECT(lua);
-  XBT_LOG_CONNECT(lua_comm);
   XBT_LOG_CONNECT(lua_host);
   XBT_LOG_CONNECT(lua_platf);
-  XBT_LOG_CONNECT(lua_process);
-  XBT_LOG_CONNECT(lua_state_cloner);
-  XBT_LOG_CONNECT(lua_task);
-  XBT_LOG_CONNECT(lua_utils);
+  XBT_LOG_CONNECT(lua_debug);
 #endif
 
   /* instr */
@@ -619,20 +603,19 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(instr_paje_values);
   XBT_LOG_CONNECT(instr_resource);
   XBT_LOG_CONNECT(instr_routing);
-  XBT_LOG_CONNECT(instr_sd);
   XBT_LOG_CONNECT(instr_surf);
   XBT_LOG_CONNECT(instr_trace);
   XBT_LOG_CONNECT(instr_TI_trace);
 
   /* jedule */
-#ifdef HAVE_JEDULE
+#if HAVE_JEDULE
   XBT_LOG_CONNECT(jedule);
   XBT_LOG_CONNECT(jed_out);
   XBT_LOG_CONNECT(jed_sd);
 #endif
 
   /* mc */
-#ifdef HAVE_MC
+#if HAVE_MC
   XBT_LOG_CONNECT(mc);
   XBT_LOG_CONNECT(mc_checkpoint);
   XBT_LOG_CONNECT(mc_comm_determinism);
@@ -640,24 +623,19 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(mc_diff);
   XBT_LOG_CONNECT(mc_dwarf);
   XBT_LOG_CONNECT(mc_hash);
-  XBT_LOG_CONNECT(mc_ignore);
-  XBT_LOG_CONNECT(mcer_ignore);
   XBT_LOG_CONNECT(mc_liveness);
-  // This one is not in libsimgrid:
-  // XBT_LOG_CONNECT(mc_main);
   XBT_LOG_CONNECT(mc_memory);
-  XBT_LOG_CONNECT(mc_memory_map);
   XBT_LOG_CONNECT(mc_page_snapshot);
   XBT_LOG_CONNECT(mc_request);
   XBT_LOG_CONNECT(mc_safety);
-  XBT_LOG_CONNECT(mc_visited);
+  XBT_LOG_CONNECT(mc_VisitedState);
   XBT_LOG_CONNECT(mc_client);
   XBT_LOG_CONNECT(mc_client_api);
   XBT_LOG_CONNECT(mc_comm_pattern);
   XBT_LOG_CONNECT(mc_process);
   XBT_LOG_CONNECT(mc_protocol);
   XBT_LOG_CONNECT(mc_RegionSnaphot);
-  XBT_LOG_CONNECT(mc_server);
+  XBT_LOG_CONNECT(mc_ModelChecker);
   XBT_LOG_CONNECT(mc_state);
 #endif
   XBT_LOG_CONNECT(mc_global);
@@ -675,16 +653,18 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(msg_synchro);
   XBT_LOG_CONNECT(msg_task);
   XBT_LOG_CONNECT(msg_vm);
-   
+
+  /* sg */
+  XBT_LOG_CONNECT(sg_host);
+
   /* simdag */
   XBT_LOG_CONNECT(sd);
   XBT_LOG_CONNECT(sd_daxparse);
-#ifdef HAVE_GRAPHVIZ
+#if HAVE_GRAPHVIZ
   XBT_LOG_CONNECT(sd_dotparse);
 #endif
   XBT_LOG_CONNECT(sd_kernel);
   XBT_LOG_CONNECT(sd_task);
-  XBT_LOG_CONNECT(sd_workstation);
 
   /* simix */
   XBT_LOG_CONNECT(simix);
@@ -705,8 +685,6 @@ static void xbt_log_connect_categories(void)
 
   /* surf */
   XBT_LOG_CONNECT(surf);
-  XBT_LOG_CONNECT(platf_generator);
-  XBT_LOG_CONNECT(random);
   XBT_LOG_CONNECT(surf_config);
   XBT_LOG_CONNECT(surf_cpu);
   XBT_LOG_CONNECT(surf_cpu_cas);
@@ -717,13 +695,7 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(surf_lagrange_dichotomy);
   XBT_LOG_CONNECT(surf_maxmin);
   XBT_LOG_CONNECT(surf_network);
-#ifdef HAVE_GTNETS
-  XBT_LOG_CONNECT(surf_network_gtnets);
-  XBT_LOG_CONNECT(surf_network_gtnets_interface);
-  XBT_LOG_CONNECT(surf_network_gtnets_simulator);
-  XBT_LOG_CONNECT(surf_network_gtnets_topology);
-#endif
-#ifdef HAVE_NS3
+#if HAVE_NS3
   XBT_LOG_CONNECT(ns3);
 #endif
   XBT_LOG_CONNECT(surf_parse);
@@ -813,7 +785,7 @@ static void log_cat_exit(xbt_log_category_t cat)
 void xbt_log_postexit(void)
 {
   XBT_VERB("Exiting log");
-  xbt_os_rmutex_destroy(log_cat_init_mutex);
+  xbt_os_mutex_destroy(log_cat_init_mutex);
   xbt_dynar_free(&xbt_log_settings);
   log_cat_exit(&_XBT_LOGV(XBT_LOG_ROOT_CAT));
 }
@@ -828,10 +800,8 @@ void _xbt_log_event_log(xbt_log_event_t ev, const char *fmt, ...)
 {
   xbt_log_category_t cat = ev->cat;
 
-  xbt_assert(ev->priority >= 0,
-             "Negative logging priority naturally forbidden");
-  xbt_assert(ev->priority < sizeof(xbt_log_priority_names),
-             "Priority %d is greater than the biggest allowed value",
+  xbt_assert(ev->priority >= 0, "Negative logging priority naturally forbidden");
+  xbt_assert(ev->priority < sizeof(xbt_log_priority_names), "Priority %d is greater than the biggest allowed value",
              ev->priority);
 
   do {
@@ -840,8 +810,7 @@ void _xbt_log_event_log(xbt_log_event_t ev, const char *fmt, ...)
     if (!appender)
       continue;                 /* No appender, try next */
 
-    xbt_assert(cat->layout,
-               "No valid layout for the appender of category %s", cat->name);
+    xbt_assert(cat->layout, "No valid layout for the appender of category %s", cat->name);
 
     /* First, try with a static buffer */
     if (XBT_LOG_STATIC_BUFFER_SIZE) {
@@ -882,18 +851,15 @@ void _xbt_log_event_log(xbt_log_event_t ev, const char *fmt, ...)
 
 /* NOTE:
  *
- * The standard logging macros use _XBT_LOG_ISENABLED, which calls
- * _xbt_log_cat_init().  Thus, if we want to avoid an infinite
- * recursion, we can not use the standard logging macros in
- * _xbt_log_cat_init(), and in all functions called from it.
+ * The standard logging macros use _XBT_LOG_ISENABLED, which calls _xbt_log_cat_init().  Thus, if we want to avoid an
+ * infinite recursion, we can not use the standard logging macros in _xbt_log_cat_init(), and in all functions called
+ * from it.
  *
- * To circumvent the problem, we define the macro_xbt_log_init() as
- * (0) for the length of the affected functions, and we do not forget
- * to undefine it at the end!
+ * To circumvent the problem, we define the macro_xbt_log_init() as (0) for the length of the affected functions, and
+ * we do not forget to undefine it at the end!
  */
 
-static void _xbt_log_cat_apply_set(xbt_log_category_t category,
-                                   xbt_log_setting_t setting)
+static void _xbt_log_cat_apply_set(xbt_log_category_t category, xbt_log_setting_t setting)
 {
 #define _xbt_log_cat_init(a, b) (0)
 
@@ -901,15 +867,13 @@ static void _xbt_log_cat_apply_set(xbt_log_category_t category,
     xbt_log_threshold_set(category, setting->thresh);
 
     XBT_DEBUG("Apply settings for category '%s': set threshold to %s (=%d)",
-           category->name, xbt_log_priority_names[category->threshold],
-           category->threshold);
+           category->name, xbt_log_priority_names[category->threshold], category->threshold);
   }
 
   if (setting->fmt) {
     xbt_log_layout_set(category, xbt_log_layout_format_new(setting->fmt));
 
-    XBT_DEBUG("Apply settings for category '%s': set format to %s",
-           category->name, setting->fmt);
+    XBT_DEBUG("Apply settings for category '%s': set format to %s", category->name, setting->fmt);
   }
 
   if (setting->additivity != -1) {
@@ -923,30 +887,25 @@ static void _xbt_log_cat_apply_set(xbt_log_category_t category,
     if (!category->layout)
       xbt_log_layout_set(category, xbt_log_layout_simple_new(NULL));
     category->additivity = 0;
-    XBT_DEBUG("Set %p as appender of category '%s'",
-           setting->appender, category->name);
+    XBT_DEBUG("Set %p as appender of category '%s'", setting->appender, category->name);
   }
 #undef _xbt_log_cat_init
 }
 
 /*
- * This gets called the first time a category is referenced and performs the
- * initialization.
+ * This gets called the first time a category is referenced and performs the initialization.
  * Also resets threshold to inherited!
  */
-int _xbt_log_cat_init(xbt_log_category_t category,
-                      e_xbt_log_priority_t priority)
+int _xbt_log_cat_init(xbt_log_category_t category, e_xbt_log_priority_t priority)
 {
 #define _xbt_log_cat_init(a, b) (0)
 
-  if (log_cat_init_mutex != NULL) {
-    xbt_os_rmutex_acquire(log_cat_init_mutex);
-  }
+  if (log_cat_init_mutex != NULL)
+    xbt_os_mutex_acquire(log_cat_init_mutex);
 
   if (category->initialized) {
-    if (log_cat_init_mutex != NULL) {
-      xbt_os_rmutex_release(log_cat_init_mutex);
-    }
+    if (log_cat_init_mutex != NULL)
+      xbt_os_mutex_release(log_cat_init_mutex);
     return priority >= category->threshold;
   }
 
@@ -954,8 +913,7 @@ int _xbt_log_cat_init(xbt_log_category_t category,
   xbt_log_setting_t setting = NULL;
   int found = 0;
 
-  XBT_DEBUG("Initializing category '%s' (firstChild=%s, nextSibling=%s)",
-         category->name,
+  XBT_DEBUG("Initializing category '%s' (firstChild=%s, nextSibling=%s)", category->name,
          (category->firstChild ? category->firstChild->name : "none"),
          (category->nextSibling ? category->nextSibling->name : "none"));
 
@@ -964,14 +922,11 @@ int _xbt_log_cat_init(xbt_log_category_t category,
     category->appender = xbt_log_default_appender;
     category->layout = xbt_log_default_layout;
   } else {
-
     if (!category->parent)
       category->parent = &_XBT_LOGV(XBT_LOG_ROOT_CAT);
 
-    XBT_DEBUG("Set %s (%s) as father of %s ",
-           category->parent->name,
-           (category->parent->initialized ?
-            xbt_log_priority_names[category->parent->threshold] : "uninited"),
+    XBT_DEBUG("Set %s (%s) as father of %s ", category->parent->name,
+           (category->parent->initialized ? xbt_log_priority_names[category->parent->threshold] : "uninited"),
            category->name);
     xbt_log_parent_set(category, category->parent);
 
@@ -989,14 +944,11 @@ int _xbt_log_cat_init(xbt_log_category_t category,
         cpp = cpp->nextSibling;
       }
 
-      XBT_DEBUG("Children of %s: %s; nextSibling: %s",
-             category->parent->name, res,
-             (category->parent->nextSibling ?
-              category->parent->nextSibling->name : "none"));
+      XBT_DEBUG("Children of %s: %s; nextSibling: %s", category->parent->name, res,
+             (category->parent->nextSibling ? category->parent->nextSibling->name : "none"));
 
       free(res);
     }
-
   }
 
   /* Apply the control */
@@ -1006,8 +958,7 @@ int _xbt_log_cat_init(xbt_log_category_t category,
 
     xbt_dynar_foreach(xbt_log_settings, cursor, setting) {
       xbt_assert(setting, "Damnit, NULL cat in the list");
-      xbt_assert(setting->catname, "NULL setting(=%p)->catname",
-                 (void *) setting);
+      xbt_assert(setting->catname, "NULL setting(=%p)->catname", (void *) setting);
 
       if (!strcmp(setting->catname, category->name)) {
         found = 1;
@@ -1018,14 +969,12 @@ int _xbt_log_cat_init(xbt_log_category_t category,
 
     if (!found)
       XBT_DEBUG("Category '%s': inherited threshold = %s (=%d)",
-                category->name, xbt_log_priority_names[category->threshold],
-                category->threshold);
+                category->name, xbt_log_priority_names[category->threshold], category->threshold);
   }
 
   category->initialized = 1;
-  if (log_cat_init_mutex != NULL) {
-    xbt_os_rmutex_release(log_cat_init_mutex);
-  }
+  if (log_cat_init_mutex != NULL)
+    xbt_os_mutex_release(log_cat_init_mutex);
   return priority >= category->threshold;
 
 #undef _xbt_log_cat_init
@@ -1038,7 +987,6 @@ void xbt_log_parent_set(xbt_log_category_t cat, xbt_log_category_t parent)
 
   /* if the category is initialized, unlink from current parent */
   if (cat->initialized) {
-
     xbt_log_category_t *cpp = &cat->parent->firstChild;
 
     while (*cpp != cat && *cpp != NULL) {
@@ -1064,31 +1012,25 @@ void xbt_log_parent_set(xbt_log_category_t cat, xbt_log_category_t parent)
 
 static void _set_inherited_thresholds(xbt_log_category_t cat)
 {
-
   xbt_log_category_t child = cat->firstChild;
 
   for (; child != NULL; child = child->nextSibling) {
     if (child->isThreshInherited) {
       if (cat != &_XBT_LOGV(log))
         XBT_VERB("Set category threshold of %s to %s (=%d)",
-              child->name, xbt_log_priority_names[cat->threshold],
-              cat->threshold);
+              child->name, xbt_log_priority_names[cat->threshold], cat->threshold);
       child->threshold = cat->threshold;
       _set_inherited_thresholds(child);
     }
   }
-
-
 }
 
-void xbt_log_threshold_set(xbt_log_category_t cat,
-                           e_xbt_log_priority_t threshold)
+void xbt_log_threshold_set(xbt_log_category_t cat, e_xbt_log_priority_t threshold)
 {
   cat->threshold = threshold;
   cat->isThreshInherited = 0;
 
   _set_inherited_thresholds(cat);
-
 }
 
 static xbt_log_setting_t _xbt_log_parse_setting(const char *control_string)
@@ -1113,7 +1055,6 @@ static xbt_log_setting_t _xbt_log_parse_setting(const char *control_string)
   dot = control_string;
   control_string += strcspn(control_string, ":= ");
   eq = control_string;
-  control_string += strcspn(control_string, " ");
 
   if(*dot != '.' && (*eq == '=' || *eq == ':'))
     xbt_die ("Invalid control string '%s'", orig_control_string);
@@ -1139,22 +1080,20 @@ static xbt_log_setting_t _xbt_log_parse_setting(const char *control_string)
 
     if(i<XBT_LOG_STATIC_THRESHOLD){
      fprintf(stderr,
-                "Priority '%s' (in setting '%s') is above allowed priority '%s'.\n\n"
-                "Compiling SimGrid with -DNDEBUG forbids the levels 'trace' and 'debug'\n"
-                "while -DNLOG forbids any logging, at any level.",
+         "Priority '%s' (in setting '%s') is above allowed priority '%s'.\n\n"
+         "Compiling SimGrid with -DNDEBUG forbids the levels 'trace' and 'debug'\n"
+         "while -DNLOG forbids any logging, at any level.",
              eq + 1, name, xbt_log_priority_names[XBT_LOG_STATIC_THRESHOLD]);
      exit(1);
     }else if (i < xbt_log_priority_infinite) {
       set->thresh = (e_xbt_log_priority_t) i;
     } else {
       THROWF(arg_error, 0,
-             "Unknown priority name: %s (must be one of: trace,debug,verbose,info,warning,error,critical)",
-             eq + 1);
+             "Unknown priority name: %s (must be one of: trace,debug,verbose,info,warning,error,critical)", eq + 1);
     }
     free(neweq);
   } else if (!strncmp(dot + 1, "add", (size_t) (eq - dot - 1)) ||
              !strncmp(dot + 1, "additivity", (size_t) (eq - dot - 1))) {
-
     char *neweq = xbt_strdup(eq + 1);
     char *p = neweq - 1;
 
@@ -1163,8 +1102,7 @@ static xbt_log_setting_t _xbt_log_parse_setting(const char *control_string)
         *p -= 'a' - 'A';
       }
     }
-    if (!strcmp(neweq, "ON") || !strcmp(neweq, "YES")
-        || !strcmp(neweq, "1")) {
+    if (!strcmp(neweq, "ON") || !strcmp(neweq, "YES") || !strcmp(neweq, "1")) {
       set->additivity = 1;
     } else {
       set->additivity = 0;
@@ -1172,15 +1110,14 @@ static xbt_log_setting_t _xbt_log_parse_setting(const char *control_string)
     free(neweq);
   } else if (!strncmp(dot + 1, "app", (size_t) (eq - dot - 1)) ||
              !strncmp(dot + 1, "appender", (size_t) (eq - dot - 1))) {
-
     char *neweq = xbt_strdup(eq + 1);
 
     if (!strncmp(neweq, "file:", 5)) {
       set->appender = xbt_log_appender_file_new(neweq + 5);
     }else if (!strncmp(neweq, "rollfile:", 9)) {
-               set->appender = xbt_log_appender2_file_new(neweq + 9,1);
+    set->appender = xbt_log_appender2_file_new(neweq + 9,1);
     }else if (!strncmp(neweq, "splitfile:", 10)) {
-               set->appender = xbt_log_appender2_file_new(neweq + 10,0);
+    set->appender = xbt_log_appender2_file_new(neweq + 10,0);
     } else {
       THROWF(arg_error, 0, "Unknown appender log type: '%s'", neweq);
     }
@@ -1189,9 +1126,8 @@ static xbt_log_setting_t _xbt_log_parse_setting(const char *control_string)
     set->fmt = xbt_strdup(eq + 1);
   } else {
     char buff[512];
-    snprintf(buff, min(512, eq - dot), "%s", dot + 1);
-    THROWF(arg_error, 0, "Unknown setting of the log category: '%s'",
-           buff);
+    snprintf(buff, MIN(512, eq - dot), "%s", dot + 1);
+    THROWF(arg_error, 0, "Unknown setting of the log category: '%s'", buff);
   }
   set->catname = (char *) xbt_malloc(dot - name + 1);
 
@@ -1202,8 +1138,7 @@ static xbt_log_setting_t _xbt_log_parse_setting(const char *control_string)
   return set;
 }
 
-static xbt_log_category_t _xbt_log_cat_searchsub(xbt_log_category_t cat,
-                                                 char *name)
+static xbt_log_category_t _xbt_log_cat_searchsub(xbt_log_category_t cat, char *name)
 {
   xbt_log_category_t child, res;
 
@@ -1231,20 +1166,16 @@ static xbt_log_category_t _xbt_log_cat_searchsub(xbt_log_category_t cat,
  *
  *      ( [category] "." [keyword] ":" value (" ")... )...
  *
- * where [category] is one the category names (see \ref XBT_log_cats for
- * a complete list of the ones defined in the SimGrid library)
- * and keyword is one of the following:
+ * where [category] is one the category names (see \ref XBT_log_cats for a complete list of the ones defined in the
+ * SimGrid library) and keyword is one of the following:
  *
  *    - thres: category's threshold priority. Possible values:
  *             TRACE,DEBUG,VERBOSE,INFO,WARNING,ERROR,CRITICAL
- *    - add or additivity: whether the logging actions must be passed to
- *      the parent category.
+ *    - add or additivity: whether the logging actions must be passed to the parent category.
  *      Possible values: 0, 1, no, yes, on, off.
  *      Default value: yes.
  *    - fmt: the format to use. See \ref log_use_conf_fmt for more information.
- *    - app or appender: the appender to use. See \ref log_use_conf_app for more
- *      information.
- *
+ *    - app or appender: the appender to use. See \ref log_use_conf_app for more information.
  */
 void xbt_log_control_set(const char *control_string)
 {
@@ -1266,8 +1197,7 @@ void xbt_log_control_set(const char *control_string)
   }
   /* some initialization if this is the first time that this get called */
   if (xbt_log_settings == NULL)
-    xbt_log_settings = xbt_dynar_new(sizeof(xbt_log_setting_t),
-                                     _free_setting);
+    xbt_log_settings = xbt_dynar_new(sizeof(xbt_log_setting_t), _free_setting);
 
   /* split the string, and remove empty entries */
   set_strings = xbt_str_split_quoted(control_string);
@@ -1277,21 +1207,18 @@ void xbt_log_control_set(const char *control_string)
     return;
   }
 
-  /* Parse each entry and either use it right now (if the category was already
-     created), or store it for further use */
+  /* Parse each entry and either use it right now (if the category was already created), or store it for further use */
   xbt_dynar_foreach(set_strings, cpt, str) {
     xbt_log_category_t cat = NULL;
 
     set = _xbt_log_parse_setting(str);
-    cat =
-        _xbt_log_cat_searchsub(&_XBT_LOGV(XBT_LOG_ROOT_CAT), set->catname);
+    cat = _xbt_log_cat_searchsub(&_XBT_LOGV(XBT_LOG_ROOT_CAT), set->catname);
 
     if (cat) {
       XBT_DEBUG("Apply directly");
       _xbt_log_cat_apply_set(cat, set);
       _free_setting((void *) &set);
     } else {
-
       XBT_DEBUG("Store for further application");
       XBT_DEBUG("push %p to the settings", (void *) set);
       xbt_dynar_push(xbt_log_settings, &set);
@@ -1314,9 +1241,7 @@ void xbt_log_layout_set(xbt_log_category_t cat, xbt_log_layout_t lay)
 {
 #define _xbt_log_cat_init(a, b) (0)
   if (!cat->appender) {
-    XBT_VERB
-        ("No appender to category %s. Setting the file appender as default",
-         cat->name);
+    XBT_VERB ("No appender to category %s. Setting the file appender as default", cat->name);
     xbt_log_appender_set(cat, xbt_log_appender_file_new(NULL));
   }
   if (cat->layout) {
@@ -1394,8 +1319,7 @@ static int xbt_log_cat_cmp(const void *pa, const void *pb)
   return strcmp(a->name, b->name);
 }
 
-static void xbt_log_help_categories_rec(xbt_log_category_t category,
-                                        const char *prefix)
+static void xbt_log_help_categories_rec(xbt_log_category_t category, const char *prefix)
 {
   char *this_prefix;
   char *child_prefix;