e_xbt_log_priority_t thresh;
int additivity;
xbt_log_appender_t appender;
-} s_xbt_log_setting_t, *xbt_log_setting_t;
+} s_xbt_log_setting_t;
+
+typedef s_xbt_log_setting_t* xbt_log_setting_t;
static xbt_dynar_t xbt_log_settings = NULL;
XBT_LOG_CONNECT(xbt_ex);
XBT_LOG_CONNECT(xbt_backtrace);
XBT_LOG_CONNECT(xbt_exception);
- XBT_LOG_CONNECT(xbt_fifo);
XBT_LOG_CONNECT(xbt_graph);
XBT_LOG_CONNECT(xbt_heap);
XBT_LOG_CONNECT(xbt_lib);
/* The following categories are only defined in libsimgrid */
/* bindings */
-#if HAVE_LUA
+#if SIMGRID_HAVE_LUA
XBT_LOG_CONNECT(lua);
XBT_LOG_CONNECT(lua_host);
XBT_LOG_CONNECT(lua_platf);
XBT_LOG_CONNECT(instr_TI_trace);
/* jedule */
-#if HAVE_JEDULE
+#if SIMGRID_HAVE_JEDULE
XBT_LOG_CONNECT(jedule);
XBT_LOG_CONNECT(jed_sd);
#endif
/* mc */
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
XBT_LOG_CONNECT(mc);
XBT_LOG_CONNECT(mc_checkpoint);
XBT_LOG_CONNECT(mc_comm_determinism);
XBT_LOG_CONNECT(surf_lagrange_dichotomy);
XBT_LOG_CONNECT(surf_maxmin);
XBT_LOG_CONNECT(surf_network);
-#if HAVE_NS3
+#if SIMGRID_HAVE_NS3
XBT_LOG_CONNECT(ns3);
#endif
XBT_LOG_CONNECT(surf_parse);
xbt_log_control_set(opt);
XBT_DEBUG("Did apply '%s' as log setting", opt);
} else if (!strcmp(argv[i], "--help-logs")) {
- help_requested |= 1;
+ help_requested |= 1U;
} else if (!strcmp(argv[i], "--help-log-categories")) {
- help_requested |= 2;
+ help_requested |= 2U;
} else {
argv[j++] = argv[i];
}
xbt_log_parent_set(category, category->parent);
if (XBT_LOG_ISENABLED(log, xbt_log_priority_debug)) {
- char *buf, *res = NULL;
+ char *buf;
+ char *res = NULL;
xbt_log_category_t cpp = category->parent->firstChild;
while (cpp) {
if (res) {
control_string += strspn(control_string, " ");
const char *name = control_string;
- control_string += strcspn(control_string, ".= ");
+ control_string += strcspn(control_string, ".:= ");
const char *dot = control_string;
control_string += strcspn(control_string, ":= ");
const char *eq = control_string;
- if(*dot != '.' && (*eq == '=' || *eq == ':'))
- xbt_die ("Invalid control string '%s'", orig_control_string);
+ xbt_assert(*dot == '.' || (*eq != '=' && *eq != ':'), "Invalid control string '%s'", orig_control_string);
if (!strncmp(dot + 1, "threshold", (size_t) (eq - dot - 1))) {
int i;
} 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);
+ xbt_die("Unknown setting of the log category: '%s'", buff);
}
set->catname = (char *) xbt_malloc(dot - name + 1);
xbt_dynar_sort(dynar, xbt_log_cat_cmp);
- for (i = 0; i < xbt_dynar_length(dynar); i++) {
+ xbt_dynar_foreach(dynar, i, cat){
if (i == xbt_dynar_length(dynar) - 1 && category->parent)
*strrchr(child_prefix, '|') = ' ';
- cat = xbt_dynar_get_as(dynar, i, xbt_log_category_t);
printf("%s%s: %s\n", this_prefix, cat->name, cat->description);
xbt_log_help_categories_rec(cat->firstChild, child_prefix);
}