-static void _apply_control(xbt_log_category_t cat) {
- int cursor;
- xbt_log_setting_t setting=NULL;
- int found = 0;
-
- if (!xbt_log_settings)
- return;
-
- xbt_assert0(cat,"NULL category");
- xbt_assert(cat->name);
-
- xbt_dynar_foreach(xbt_log_settings,cursor,setting) {
- xbt_assert0(setting,"Damnit, NULL cat in the list");
- xbt_assert1(setting->catname,"NULL setting(=%p)->catname",(void*)setting);
-
- if (!strcmp(setting->catname,cat->name)) {
- found = 1;
-
- xbt_log_threshold_set(cat, setting->thresh);
- xbt_dynar_cursor_rm(xbt_log_settings,&cursor);
-
- if (cat->threshold <= xbt_log_priority_debug) {
- s_xbt_log_event_t _log_ev =
- {cat,xbt_log_priority_debug,__FILE__,_XBT_FUNCTION,__LINE__};
- _xbt_log_event_log(&_log_ev,
- "Apply settings for category '%s': set threshold to %s (=%d)",
- cat->name,
- xbt_log_priority_names[cat->threshold], cat->threshold);
- }
- }
- }
- if (!found && cat->threshold <= xbt_log_priority_verbose) {
- s_xbt_log_event_t _log_ev =
- {cat,xbt_log_priority_verbose,__FILE__,_XBT_FUNCTION,__LINE__};
- _xbt_log_event_log(&_log_ev,
- "Category '%s': inherited threshold = %s (=%d)",
- cat->name,
- xbt_log_priority_names[cat->threshold], cat->threshold);
- }
-
-}
-