XBT_LOG_CONNECT(msg_process, msg);
XBT_LOG_CONNECT(msg_task, msg);
- /* sd */
+ /* simdag */
XBT_LOG_CONNECT(sd_daxparse, sd);
+#ifdef HAVE_GRAPHVIZ
XBT_LOG_CONNECT(sd_dotparse, sd);
+#endif
XBT_LOG_CONNECT(sd_kernel, sd);
XBT_LOG_CONNECT(sd_task, sd);
XBT_LOG_CONNECT(sd_workstation, sd);
#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;
// _XBT_LOGV(log).threshold = xbt_log_priority_debug; /* uncomment to set the LOG category to debug directly */
+ xbt_log_connect_categories();
+
/* Set logs and init log submodule */
for (j = i = 1; i < *argc; i++) {
if (!strncmp(argv[i], "--log=", strlen("--log="))) {
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];
}
*argc = j;
}
- 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), " ");