Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Let the xbt_log module register its finalizer itself
[simgrid.git] / src / xbt / log.cpp
1 /* log - a generic logging facility in the spirit of log4j                  */
2
3 /* Copyright (c) 2004-2023. The SimGrid Team. All rights reserved.          */
4
5 /* This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package. */
7
8 #include "src/xbt/log_private.hpp"
9 #include "xbt/string.hpp"
10 #include "xbt/sysdep.h"
11
12 #include <algorithm>
13 #include <array>
14 #include <boost/tokenizer.hpp>
15 #include <cstring>
16 #include <mutex>
17 #include <string>
18 #include <vector>
19
20 int xbt_log_no_loc = 0; /* if set to true (with --log=no_loc), file localization will be omitted (for tesh tests) */
21
22 struct xbt_log_setting_t {
23   std::string catname;
24   std::string fmt;
25   e_xbt_log_priority_t thresh = xbt_log_priority_uninitialized;
26   int additivity              = -1;
27   xbt_log_appender_t appender = nullptr;
28 };
29
30 // This function is here to avoid static initialization order fiasco
31 static auto& xbt_log_settings()
32 {
33   static std::vector<xbt_log_setting_t> value;
34   return value;
35 }
36
37 constexpr std::array<const char*, xbt_log_priority_infinite> xbt_log_priority_names{
38     {"NONE", "TRACE", "DEBUG", "VERBOSE", "INFO", "WARNING", "ERROR", "CRITICAL"}};
39
40 s_xbt_log_category_t _XBT_LOGV(XBT_LOG_ROOT_CAT) = {
41     nullptr /*parent */,
42     nullptr /* firstChild */,
43     nullptr /* nextSibling */,
44     "root",
45     "The common ancestor for all categories",
46     0 /*initialized */,
47     xbt_log_priority_uninitialized /* threshold */,
48     0 /* isThreshInherited */,
49     nullptr /* appender */,
50     nullptr /* layout */,
51     0 /* additivity */
52 };
53
54 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(log, xbt, "Loggings from the logging mechanism itself");
55
56 static void xbt_log_help();
57 static void xbt_log_help_categories();
58 static void xbt_log_postexit();
59
60 void xbt_log_init(int *argc, char **argv)
61 {
62   unsigned help_requested = 0;  /* 1: logs; 2: categories */
63   int j                   = 1;
64   int parse_args          = 1; // Stop parsing the parameters once we found '--'
65
66   xbt_log_control_set("xbt_help.app:stdout xbt_help.threshold:VERBOSE xbt_help.fmt:%m%n");
67   atexit(xbt_log_postexit);
68
69   /* Set logs and init log submodule */
70   for (int i = 1; i < *argc; i++) {
71     if (strcmp("--", argv[i]) == 0) {
72       parse_args = 0;
73       argv[j++]  = argv[i]; // Keep the '--' for sg_config
74     } else if (parse_args && strncmp(argv[i], "--log=", strlen("--log=")) == 0) {
75       char* opt = strchr(argv[i], '=');
76       opt++;
77       xbt_log_control_set(opt);
78       XBT_DEBUG("Did apply '%s' as log setting", opt);
79     } else if (parse_args && strcmp(argv[i], "--help-logs") == 0) {
80       help_requested |= 1U;
81     } else if (parse_args && strcmp(argv[i], "--help-log-categories") == 0) {
82       help_requested |= 2U;
83     } else {
84       argv[j++] = argv[i];
85     }
86   }
87   if (j < *argc) {
88     argv[j] = nullptr;
89     *argc = j;
90   }
91
92   if (help_requested) {
93     if (help_requested & 1)
94       xbt_log_help();
95     if (help_requested & 2)
96       xbt_log_help_categories();
97     exit(0);
98   }
99 }
100
101 static void log_cat_exit(const s_xbt_log_category_t* cat)
102 {
103   if (cat->appender) {
104     if (cat->appender->free_)
105       cat->appender->free_(cat->appender);
106     xbt_free(cat->appender);
107   }
108   if (cat->layout) {
109     if (cat->layout->free_)
110       cat->layout->free_(cat->layout);
111     xbt_free(cat->layout);
112   }
113
114   for (auto const* child = cat->firstChild; child != nullptr; child = child->nextSibling)
115     log_cat_exit(child);
116 }
117
118 static void xbt_log_postexit(void)
119 {
120   XBT_VERB("Exiting log");
121   log_cat_exit(&_XBT_LOGV(XBT_LOG_ROOT_CAT));
122 }
123
124 /* Size of the static string in which we build the log string */
125 static constexpr size_t XBT_LOG_STATIC_BUFFER_SIZE = 2048;
126 /* Minimum size of the dynamic string in which we build the log string
127    (should be greater than XBT_LOG_STATIC_BUFFER_SIZE) */
128 static constexpr size_t XBT_LOG_DYNAMIC_BUFFER_SIZE = 4096;
129
130 void _xbt_log_event_log(xbt_log_event_t ev, const char *fmt, ...)
131 {
132   const xbt_log_category_s* cat = ev->cat;
133
134   xbt_assert(ev->priority >= 0, "Negative logging priority naturally forbidden");
135   xbt_assert(static_cast<size_t>(ev->priority) < xbt_log_priority_names.size(),
136              "Priority %d is greater than the biggest allowed value", ev->priority);
137
138   while (true) {
139     if (const s_xbt_log_appender_t* appender = cat->appender) {
140       xbt_assert(cat->layout, "No valid layout for the appender of category %s", cat->name);
141
142       /* First, try with a static buffer */
143       bool done = false;
144       std::array<char, XBT_LOG_STATIC_BUFFER_SIZE> buff;
145       ev->buffer      = buff.data();
146       ev->buffer_size = buff.size();
147       va_start(ev->ap, fmt);
148       done = cat->layout->do_layout(cat->layout, ev, fmt);
149       va_end(ev->ap);
150       ev->buffer = nullptr; // Calm down, static analyzers, this pointer to local array won't leak out of the scope.
151       if (done) {
152         appender->do_append(appender, buff.data());
153       } else {
154         /* The static buffer was too small, use a dynamically expanded one */
155         ev->buffer_size = XBT_LOG_DYNAMIC_BUFFER_SIZE;
156         ev->buffer      = static_cast<char*>(xbt_malloc(ev->buffer_size));
157         while (true) {
158           va_start(ev->ap, fmt);
159           done = cat->layout->do_layout(cat->layout, ev, fmt);
160           va_end(ev->ap);
161           if (done)
162             break; /* Got it */
163           ev->buffer_size *= 2;
164           ev->buffer = static_cast<char*>(xbt_realloc(ev->buffer, ev->buffer_size));
165         }
166         appender->do_append(appender, ev->buffer);
167         xbt_free(ev->buffer);
168       }
169     }
170
171     if (not cat->additivity)
172       break;
173     cat = cat->parent;
174   }
175 }
176
177 /* NOTE:
178  *
179  * The standard logging macros use _XBT_LOG_ISENABLED, which calls _xbt_log_cat_init().  Thus, if we want to avoid an
180  * infinite recursion, we can not use the standard logging macros in _xbt_log_cat_init(), and in all functions called
181  * from it.
182  *
183  * To circumvent the problem, we define the macro DISABLE_XBT_LOG_CAT_INIT() to hide the real _xbt_log_cat_init(). The
184  * macro has to be called at the beginning of the affected functions.
185  */
186 static int fake_xbt_log_cat_init(xbt_log_category_t, e_xbt_log_priority_t)
187 {
188   return 0;
189 }
190 #define DISABLE_XBT_LOG_CAT_INIT()                                                                                     \
191  XBT_ATTRIB_UNUSED int (*_xbt_log_cat_init)(xbt_log_category_t, e_xbt_log_priority_t) = fake_xbt_log_cat_init
192
193 static void _xbt_log_cat_apply_set(xbt_log_category_t category, const xbt_log_setting_t& setting)
194 {
195   DISABLE_XBT_LOG_CAT_INIT();
196   if (setting.thresh != xbt_log_priority_uninitialized) {
197     xbt_log_threshold_set(category, setting.thresh);
198
199     XBT_DEBUG("Apply settings for category '%s': set threshold to %s (=%d)",
200            category->name, xbt_log_priority_names[category->threshold], category->threshold);
201   }
202
203   if (not setting.fmt.empty()) {
204     xbt_log_layout_set(category, xbt_log_layout_format_new(setting.fmt.c_str()));
205
206     XBT_DEBUG("Apply settings for category '%s': set format to %s", category->name, setting.fmt.c_str());
207   }
208
209   if (setting.additivity != -1) {
210     xbt_log_additivity_set(category, setting.additivity);
211
212     XBT_DEBUG("Apply settings for category '%s': set additivity to %s", category->name,
213               (setting.additivity ? "on" : "off"));
214   }
215   if (setting.appender) {
216     xbt_log_appender_set(category, setting.appender);
217     if (not category->layout)
218       xbt_log_layout_set(category, xbt_log_layout_simple_new(nullptr));
219     category->additivity = 0;
220     XBT_DEBUG("Set %p as appender of category '%s'", setting.appender, category->name);
221   }
222 }
223
224 /*
225  * This gets called the first time a category is referenced and performs the initialization.
226  * Also resets threshold to inherited!
227  */
228 int _xbt_log_cat_init(xbt_log_category_t category, e_xbt_log_priority_t priority)
229 {
230   DISABLE_XBT_LOG_CAT_INIT();
231   if (category->initialized)
232     return priority >= category->threshold;
233
234   static std::recursive_mutex log_cat_init_mutex;
235   log_cat_init_mutex.lock();
236
237   XBT_DEBUG("Initializing category '%s' (firstChild=%s, nextSibling=%s)", category->name,
238          (category->firstChild ? category->firstChild->name : "none"),
239          (category->nextSibling ? category->nextSibling->name : "none"));
240
241   if (category == &_XBT_LOGV(XBT_LOG_ROOT_CAT)) {
242     category->threshold = xbt_log_priority_info;
243     category->appender  = xbt_log_appender_stream(stderr);
244     category->layout    = xbt_log_layout_simple_new(nullptr);
245   } else {
246     if (not category->parent)
247       category->parent = &_XBT_LOGV(XBT_LOG_ROOT_CAT);
248
249     XBT_DEBUG("Set %s (%s) as father of %s ", category->parent->name,
250            (category->parent->initialized ? xbt_log_priority_names[category->parent->threshold] : "uninited"),
251            category->name);
252     xbt_log_parent_set(category, category->parent);
253
254     if (XBT_LOG_ISENABLED(log, xbt_log_priority_debug)) {
255       std::string res;
256       const xbt_log_category_s* cpp = category->parent->firstChild;
257       while (cpp) {
258         res += std::string(" ") + cpp->name;
259         cpp = cpp->nextSibling;
260       }
261
262       XBT_DEBUG("Children of %s:%s; nextSibling: %s", category->parent->name, res.c_str(),
263                 (category->parent->nextSibling ? category->parent->nextSibling->name : "none"));
264     }
265   }
266
267   /* Apply the control */
268   if (auto iset = std::find_if(begin(xbt_log_settings()), end(xbt_log_settings()),
269                                [category](const xbt_log_setting_t& s) { return s.catname == category->name; });
270       iset != xbt_log_settings().end()) {
271     _xbt_log_cat_apply_set(category, *iset);
272     xbt_log_settings().erase(iset);
273   } else {
274     XBT_DEBUG("Category '%s': inherited threshold = %s (=%d)", category->name,
275               xbt_log_priority_names[category->threshold], category->threshold);
276   }
277
278   category->initialized = 1;
279   log_cat_init_mutex.unlock();
280   return priority >= category->threshold;
281 }
282
283 void xbt_log_parent_set(xbt_log_category_t cat, xbt_log_category_t parent)
284 {
285   xbt_assert(cat, "NULL category to be given a parent");
286   xbt_assert(parent, "The parent category of %s is NULL", cat->name);
287
288   /* if the category is initialized, unlink from current parent */
289   if (cat->initialized) {
290     xbt_log_category_t *cpp = &cat->parent->firstChild;
291
292     while (*cpp != cat && *cpp != nullptr) {
293       cpp = &(*cpp)->nextSibling;
294     }
295
296     xbt_assert(*cpp == cat);
297     *cpp = cat->nextSibling;
298   }
299
300   cat->parent = parent;
301   cat->nextSibling = parent->firstChild;
302
303   parent->firstChild = cat;
304
305   if (not parent->initialized)
306     (void)_xbt_log_cat_init(parent, xbt_log_priority_uninitialized /* ignored */);
307
308   cat->threshold = parent->threshold;
309
310   cat->isThreshInherited = 1;
311 }
312
313 static void _set_inherited_thresholds(const s_xbt_log_category_t* cat)
314 {
315   xbt_log_category_t child = cat->firstChild;
316
317   for (; child != nullptr; child = child->nextSibling) {
318     if (child->isThreshInherited) {
319       if (cat != &_XBT_LOGV(log))
320         XBT_VERB("Set category threshold of %s to %s (=%d)",
321               child->name, xbt_log_priority_names[cat->threshold], cat->threshold);
322       child->threshold = cat->threshold;
323       _set_inherited_thresholds(child);
324     }
325   }
326 }
327
328 void xbt_log_threshold_set(xbt_log_category_t cat, e_xbt_log_priority_t threshold)
329 {
330   cat->threshold = threshold;
331   cat->isThreshInherited = 0;
332
333   _set_inherited_thresholds(cat);
334 }
335
336 static xbt_log_setting_t _xbt_log_parse_setting(const char *control_string)
337 {
338   const char *orig_control_string = control_string;
339   xbt_log_setting_t set;
340
341   if (not*control_string)
342     return set;
343   XBT_DEBUG("Parse log setting '%s'", control_string);
344
345   control_string += strspn(control_string, " ");
346   const char* name = control_string;
347   control_string += strcspn(control_string, ".:= ");
348   const char* option = control_string;
349   control_string += strcspn(control_string, ":= ");
350   const char* value = control_string;
351
352   xbt_assert(*option == '.' && (*value == '=' || *value == ':'), "Invalid control string '%s'", orig_control_string);
353
354   size_t name_len = option - name;
355   ++option;
356   size_t option_len = value - option;
357   ++value;
358
359   if (strncmp(option, "threshold", option_len) == 0) {
360     XBT_DEBUG("New priority name = %s", value);
361     int i;
362     for (i = 0; i < xbt_log_priority_infinite; i++) {
363       if (strcasecmp(value, xbt_log_priority_names[i]) == 0) {
364         XBT_DEBUG("This is priority %d", i);
365         break;
366       }
367     }
368
369     if(i<XBT_LOG_STATIC_THRESHOLD){
370       fprintf(stderr, "Priority '%s' (in setting '%s') is above allowed priority '%s'.\n\n"
371                       "Compiling SimGrid with -DNDEBUG forbids the levels 'trace' and 'debug'\n"
372                       "while -DNLOG forbids any logging, at any level.",
373               value, name, xbt_log_priority_names[XBT_LOG_STATIC_THRESHOLD]);
374       exit(1);
375     }else if (i < xbt_log_priority_infinite) {
376       set.thresh = (e_xbt_log_priority_t)i;
377     } else {
378       throw std::invalid_argument(simgrid::xbt::string_printf(
379           "Unknown priority name: %s (must be one of: trace,debug,verbose,info,warning,error,critical)", value));
380     }
381   } else if (strncmp(option, "additivity", option_len) == 0) {
382     set.additivity = (strcasecmp(value, "ON") == 0 || strcasecmp(value, "YES") == 0 || strcmp(value, "1") == 0);
383   } else if (strncmp(option, "appender", option_len) == 0) {
384     if (strncmp(value, "file:", 5) == 0) {
385       set.appender = xbt_log_appender_file_new(value + 5);
386     } else if (strncmp(value, "rollfile:", 9) == 0) {
387       set.appender = xbt_log_appender2_file_new(value + 9, 1);
388     } else if (strncmp(value, "splitfile:", 10) == 0) {
389       set.appender = xbt_log_appender2_file_new(value + 10, 0);
390     } else if (strcmp(value, "stderr") == 0) {
391       set.appender = xbt_log_appender_stream(stderr);
392     } else if (strcmp(value, "stdout") == 0) {
393       set.appender = xbt_log_appender_stream(stdout);
394     } else {
395       throw std::invalid_argument(simgrid::xbt::string_printf("Unknown appender log type: '%s'", value));
396     }
397   } else if (strncmp(option, "fmt", option_len) == 0) {
398     set.fmt = value;
399   } else {
400     xbt_die("Unknown setting of the log category: '%.*s'", static_cast<int>(option_len), option);
401   }
402   set.catname = std::string(name, name_len);
403
404   XBT_DEBUG("This is for cat '%s'", set.catname.c_str());
405
406   return set;
407 }
408
409 static xbt_log_category_t _xbt_log_cat_searchsub(xbt_log_category_t cat, const char* name)
410 {
411   XBT_DEBUG("Search '%s' into '%s' (firstChild='%s'; nextSibling='%s')", name,
412          cat->name, (cat->firstChild ? cat->firstChild->name : "none"),
413          (cat->nextSibling ? cat->nextSibling->name : "none"));
414   if (strcmp(cat->name, name) == 0)
415     return cat;
416
417   for (xbt_log_category_t child = cat->firstChild; child != nullptr; child = child->nextSibling) {
418     XBT_DEBUG("Dig into %s", child->name);
419     xbt_log_category_t res = _xbt_log_cat_searchsub(child, name);
420     if (res)
421       return res;
422   }
423
424   return nullptr;
425 }
426
427 void xbt_log_control_set(const char *control_string)
428 {
429   if (not control_string)
430     return;
431   XBT_DEBUG("Parse log settings '%s'", control_string);
432
433   /* Special handling of no_loc request, which asks for any file localization to be omitted (for tesh runs) */
434   if (strcmp(control_string, "no_loc") == 0) {
435     xbt_log_no_loc = 1;
436     return;
437   }
438   /* Split the string, and remove empty entries
439      Parse each entry and either use it right now (if the category was already created), or store it for further use */
440   std::string parsed_control_string(control_string);
441   boost::escaped_list_separator<char> sep("\\", " ", "\"'");
442   boost::tokenizer<boost::escaped_list_separator<char>> tok(parsed_control_string, sep);
443   for (const auto& str : tok) {
444     if (str.empty())
445       continue;
446
447     xbt_log_setting_t set  = _xbt_log_parse_setting(str.c_str());
448     xbt_log_category_t cat = _xbt_log_cat_searchsub(&_XBT_LOGV(XBT_LOG_ROOT_CAT), set.catname.c_str());
449
450     if (cat) {
451       XBT_DEBUG("Apply directly");
452       _xbt_log_cat_apply_set(cat, set);
453     } else {
454       XBT_DEBUG("Store for further application");
455       XBT_DEBUG("push %p to the settings", &set);
456       xbt_log_settings().emplace_back(std::move(set));
457     }
458   }
459 }
460
461 void xbt_log_appender_set(xbt_log_category_t cat, xbt_log_appender_t app)
462 {
463   if (cat->appender) {
464     if (cat->appender->free_)
465       cat->appender->free_(cat->appender);
466     xbt_free(cat->appender);
467   }
468   cat->appender = app;
469 }
470
471 void xbt_log_layout_set(xbt_log_category_t cat, xbt_log_layout_t lay)
472 {
473   DISABLE_XBT_LOG_CAT_INIT();
474   if (not cat->appender) {
475     XBT_VERB ("No appender to category %s. Setting the file appender as default", cat->name);
476     xbt_log_appender_set(cat, xbt_log_appender_file_new(nullptr));
477   }
478   if (cat->layout) {
479     if (cat->layout->free_) {
480       cat->layout->free_(cat->layout);
481     }
482     xbt_free(cat->layout);
483   }
484   cat->layout = lay;
485   xbt_log_additivity_set(cat, 0);
486 }
487
488 void xbt_log_additivity_set(xbt_log_category_t cat, int additivity)
489 {
490   cat->additivity = additivity;
491 }
492
493 static void xbt_log_help()
494 {
495   XBT_HELP(
496       "Description of the logging output:\n"
497       "\n"
498       "   Threshold configuration: --log=CATEGORY_NAME.thres:PRIORITY_LEVEL\n"
499       "      CATEGORY_NAME: defined in code with function 'XBT_LOG_NEW_CATEGORY'\n"
500       "      PRIORITY_LEVEL: the level to print (trace,debug,verbose,info,warning,error,critical)\n"
501       "         -> trace: enter and return of some functions\n"
502       "         -> debug: crufty output\n"
503       "         -> verbose: verbose output for the user wanting more\n"
504       "         -> info: output about the regular functioning\n"
505       "         -> warning: minor issue encountered\n"
506       "         -> error: issue encountered\n"
507       "         -> critical: major issue encountered\n"
508       "      The default priority level is 'info'.\n"
509       "\n"
510       "   Format configuration: --log=CATEGORY_NAME.fmt:FORMAT\n"
511       "      FORMAT string may contain:\n"
512       "         -> %%%%: the %% char\n"
513       "         -> %%n: platform-dependent line separator (LOG4J compatible)\n"
514       "         -> %%e: plain old space (SimGrid extension)\n"
515       "\n"
516       "         -> %%m: user-provided message\n"
517       "\n"
518       "         -> %%c: Category name (LOG4J compatible)\n"
519       "         -> %%p: Priority name (LOG4J compatible)\n"
520       "\n"
521       "         -> %%h: Hostname (SimGrid extension)\n"
522       "         -> %%a: Actor name (SimGrid extension)\n"
523       "         -> %%t: Thread \"name\" (LOG4J compatible -- actually the address of the thread in memory)\n"
524       "         -> %%i: Process PID (SimGrid extension -- this is a 'i' as in 'i'dea)\n"
525       "\n"
526       "         -> %%F: file name where the log event was raised (LOG4J compatible)\n"
527       "         -> %%l: location where the log event was raised (LOG4J compatible, like '%%F:%%L' -- this is a l as "
528       "in 'l'etter)\n"
529       "         -> %%L: line number where the log event was raised (LOG4J compatible)\n"
530       "         -> %%M: function name (LOG4J compatible -- called method name here of course).\n"
531       "\n"
532       "         -> %%b: full backtrace (Called %%throwable in LOG4J). Defined only when using the GNU libc because\n"
533       "                 backtrace() is not defined elsewhere.\n"
534       "         -> %%B: short backtrace (only the first line of the %%b). Called %%throwable{short} in LOG4J; "
535       "defined where %%b is.\n"
536       "\n"
537       "         -> %%d: date (UNIX-like epoch)\n"
538       "         -> %%r: application age (time elapsed since the beginning of the application)\n"
539       "\n"
540       "   Category appender: --log=CATEGORY_NAME.app:APPENDER\n"
541       "      APPENDER may be:\n"
542       "         -> stdout or stderr: standard output streams\n"
543       "         -> file:NAME: append to file with given name\n"
544       "         -> splitfile:SIZE:NAME: append to files with maximum size SIZE per file.\n"
545       "                                 NAME may contain the %% wildcard as a placeholder for the file number.\n"
546       "         -> rollfile:SIZE:NAME: append to file with maximum size SIZE.\n"
547       "\n"
548       "   Category additivity: --log=CATEGORY_NAME.add:VALUE\n"
549       "      VALUE:  '0', '1', 'no', 'yes', 'on', or 'off'\n"
550       "\n"
551       "   Miscellaneous:\n"
552       "      --help-log-categories    Display the current hierarchy of log categories.\n"
553       "      --log=no_loc             Don't print file names in messages (for tesh tests).\n");
554 }
555
556 static void xbt_log_help_categories_rec(xbt_log_category_t category, const std::string& prefix)
557 {
558   if (not category)
559     return;
560
561   std::string this_prefix(prefix);
562   std::string child_prefix(prefix);
563   if (category->parent) {
564     this_prefix  += " \\_ ";
565     child_prefix += " |  ";
566   }
567
568   std::vector<xbt_log_category_t> cats;
569   for (xbt_log_category_t cat = category; cat != nullptr; cat = cat->nextSibling)
570     cats.push_back(cat);
571
572   std::sort(begin(cats), end(cats),
573             [](const s_xbt_log_category_t* a, const s_xbt_log_category_t* b) { return strcmp(a->name, b->name) < 0; });
574
575   for (auto const& cat : cats) {
576     XBT_HELP("%s%s: %s", this_prefix.c_str(), cat->name, cat->description);
577     if (cat == cats.back() && category->parent)
578       child_prefix[child_prefix.rfind('|')] = ' ';
579     xbt_log_help_categories_rec(cat->firstChild, child_prefix);
580   }
581 }
582
583 static void xbt_log_help_categories()
584 {
585   XBT_HELP("Current log category hierarchy:");
586   xbt_log_help_categories_rec(&_XBT_LOGV(XBT_LOG_ROOT_CAT), "   ");
587   XBT_HELP("%s", "");
588 }