/* Public functions again */
/* ********************** */
-/**
- * \ingroup XBT_log
- *
- * Prints some help about using the logging infrastructure.
- */
-XBT_PUBLIC(void) xbt_log_help(void);
-
-/**
- * \ingroup XBT_log
- *
- * Prints the log category hierarchy.
- */
-XBT_PUBLIC(void) xbt_log_help_categories(void);
-
/**
* \ingroup XBT_log
* \param catName name of the category
surf_optimization_mode_description[k].description);
printf("Both network and CPU models have 'Lazy' as default optimization level\n\n");
shall_exit = 1;
- } else if (!strcmp(argv[i], "--help-logs")) {
- xbt_log_help();
- shall_exit = 1;
- } else if (!strcmp(argv[i], "--help-log-categories")) {
- xbt_log_help_categories();
- shall_exit = 1;
#ifdef HAVE_TRACING
} else if (!strcmp(argv[i], "--help-tracing")) {
TRACE_help (1);
#endif /* simgrid_EXPORTS */
}
+static void xbt_log_help(void);
+static void xbt_log_help_categories(void);
+
/** @brief Get all logging settings from the command line
*
* xbt_log_control_set() is called on each string we got from cmd line
*/
void xbt_log_init(int *argc, char **argv)
{
+ unsigned help_requested = 0; /* 1: logs; 2: categories */
int i, j;
char *opt;
opt++;
xbt_log_control_set(opt);
XBT_DEBUG("Did apply '%s' as log setting", opt);
+ } else if (!strcmp(argv[i], "--help-logs")) {
+ help_requested |= 1;
+ } else if (!strcmp(argv[i], "--help-log-categories")) {
+ help_requested |= 2;
} else {
argv[j++] = argv[i];
}
}
xbt_log_connect_categories();
+
+ if (help_requested) {
+ if (help_requested & 1)
+ xbt_log_help();
+ if (help_requested & 2)
+ xbt_log_help_categories();
+ exit(0);
+ }
}
static void log_cat_exit(xbt_log_category_t cat)
cat->additivity = additivity;
}
-void xbt_log_help(void)
+static void xbt_log_help(void)
{
printf(
"Description of the logging output:\n"
xbt_free(child_prefix);
}
-void xbt_log_help_categories(void)
+static void xbt_log_help_categories(void)
{
printf("Current log category hierarchy:\n");
xbt_log_help_categories_rec(&_XBT_LOGV(XBT_LOG_ROOT_CAT), " ");