* 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

@ -994,16 +994,11 @@ xmldb_get_cache(clicon_handle h,
if (disable_nacm_on_empty(x1t, yspec) < 0)
goto done;
}
/* Copy the matching parts of the (relevant) XML tree.
* If cache was empty, also update to datastore cache
*/
if (clicon_debug_get()>1)
if (clixon_xml2file(stderr, x1t, 0, 1, fprintf, 0, 0) < 0)
goto done;
clicon_debug_xml(CLIXON_DBG_DETAIL, x1t, "%s", __FUNCTION__);
*xtop = x1t;
retval = 1;
done:
clicon_debug(2, "%s retval:%d", __FUNCTION__, retval);
clicon_debug(CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
if (xvec)
free(xvec);
return retval;
@ -1154,7 +1149,7 @@ xmldb_get_zerocopy(clicon_handle h,
*xtop = x0t;
retval = 1;
done:
clicon_debug(2, "%s retval:%d", __FUNCTION__, retval);
clicon_debug(CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
if (xvec)
free(xvec);
return retval;