/* Set debugging levels:
*
- * mod:facility:level mod2:facility:level ...
+ * mod[:facility[:level]] mod2[:facility[:level]] ...
*
* Return null if successful, otherwise an error message that the caller must
* free().
facility = strtok_r(NULL, ":", &save_ptr);
level = strtok_r(NULL, ":", &save_ptr);
- if (level == NULL || facility == NULL) {
- free(s);
- return xstrdup("syntax error in level string");
- }
if (!strcmp(module, "ANY")) {
e_module = VLM_ANY_MODULE;
}
}
- if (!strcmp(facility, "ANY")) {
+ if (!facility || !strcmp(facility, "ANY")) {
e_facility = VLF_ANY_FACILITY;
} else {
e_facility = vlog_get_facility_val(facility);
}
}
- e_level = vlog_get_level_val(level);
+ e_level = level ? vlog_get_level_val(level) : VLL_DBG;
if (e_level >= VLL_N_LEVELS) {
char *msg = xasprintf("unknown level \"%s\"", level);
free(s);