* Changed debug levels in clicon_debug() to be based on maskable flags

* Added flag names: `CLIXON_DBG_*`
  * Added maskable flags that can be combined when debugging:
    * `DEFAULT` = 1: Basic debug message, espcially initialization
    * `MSG` = 2: Input and output packets, read datastore
    * `DETAIL` = 4: Details: message dump in hex, xpath parse trees, etc
    * `EXTRA` = 8: Extra detailed logs
* Test: some errors in yang-lib where content-id was in wrong place
This commit is contained in:
Olof hagsand 2023-01-27 10:08:07 +01:00 committed by Olof Hagsand
parent 8342b74968
commit da9bfcbb53
47 changed files with 425 additions and 210 deletions

View file

@ -194,7 +194,7 @@ clixon_event_reg_fd(int fd,
e->e_type = EVENT_FD;
e->e_next = ee;
ee = e;
clicon_debug(2, "%s, registering %s", __FUNCTION__, e->e_string);
clicon_debug(CLIXON_DBG_DETAIL, "%s, registering %s", __FUNCTION__, e->e_string);
return 0;
}
@ -276,7 +276,7 @@ clixon_event_reg_timeout(struct timeval t,
}
e->e_next = e1;
*e_prev = e;
clicon_debug(2, "%s: %s", __FUNCTION__, str);
clicon_debug(CLIXON_DBG_DETAIL, "%s: %s", __FUNCTION__, str);
return 0;
}
@ -414,7 +414,7 @@ clixon_event_loop(clicon_handle h)
if (n==0){ /* Timeout */
e = ee_timers;
ee_timers = ee_timers->e_next;
clicon_debug(2, "%s timeout: %s", __FUNCTION__, e->e_string);
clicon_debug(CLIXON_DBG_DETAIL, "%s timeout: %s", __FUNCTION__, e->e_string);
if ((*e->e_fn)(0, e->e_arg) < 0){
free(e);
goto err;
@ -428,7 +428,7 @@ clixon_event_loop(clicon_handle h)
}
e_next = e->e_next;
if(e->e_type == EVENT_FD && FD_ISSET(e->e_fd, &fdset)){
clicon_debug(2, "%s: FD_ISSET: %s", __FUNCTION__, e->e_string);
clicon_debug(CLIXON_DBG_DETAIL, "%s: FD_ISSET: %s", __FUNCTION__, e->e_string);
if ((*e->e_fn)(e->e_fd, e->e_arg) < 0){
clicon_debug(1, "%s Error in: %s", __FUNCTION__, e->e_string);
goto err;