From 86667a0190f53c70c20120f584ccd81cf3a7cd5b Mon Sep 17 00:00:00 2001 From: Philip Prindeville Date: Thu, 4 Jan 2024 13:56:13 -0700 Subject: [PATCH] Don't use literal for CLIXON_DBG_XXX --- apps/backend/backend_get.c | 4 ++-- apps/netconf/netconf_main.c | 2 +- apps/restconf/restconf_methods.c | 2 +- apps/restconf/restconf_methods_patch.c | 2 +- apps/restconf/restconf_methods_post.c | 12 ++++++------ lib/src/clixon_xml_map.c | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/backend/backend_get.c b/apps/backend/backend_get.c index 15be8bcc..7119238d 100644 --- a/apps/backend/backend_get.c +++ b/apps/backend/backend_get.c @@ -769,7 +769,7 @@ get_list_pagination(clixon_handle h, if ((ret = xml_bind_yang(h, xret, YB_MODULE, yspec, &xerr)) < 0) goto done; if (ret == 0){ - clixon_debug_xml(1, xret, "Yang bind pagination state"); + clixon_debug_xml(CLIXON_DBG_DEFAULT, xret, "Yang bind pagination state"); if (clixon_netconf_internal_error(xerr, ". Internal error, state callback returned invalid XML", NULL) < 0) @@ -1018,7 +1018,7 @@ get_common(clixon_handle h, (ret = xml_yang_validate_add(h, xret, &xerr)) < 0) goto done; if (ret == 0){ - clixon_debug_xml(1, xret, "VALIDATE_STATE"); + clixon_debug_xml(CLIXON_DBG_DEFAULT, xret, "VALIDATE_STATE"); if (clixon_netconf_internal_error(xerr, ". Internal error, state callback returned invalid XML", NULL) < 0) diff --git a/apps/netconf/netconf_main.c b/apps/netconf/netconf_main.c index 96bff6e2..834cfffe 100644 --- a/apps/netconf/netconf_main.c +++ b/apps/netconf/netconf_main.c @@ -335,7 +335,7 @@ netconf_input_packet(clixon_handle h, netconf_framing_type framing; clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__); - clixon_debug_xml(1, xreq, "%s", __FUNCTION__); + clixon_debug_xml(CLIXON_DBG_DEFAULT, xreq, "%s", __FUNCTION__); rpcname = xml_name(xreq); rpcprefix = xml_prefix(xreq); framing = clicon_data_int_get(h, NETCONF_FRAMING_TYPE); diff --git a/apps/restconf/restconf_methods.c b/apps/restconf/restconf_methods.c index 913e8229..ac984b96 100644 --- a/apps/restconf/restconf_methods.c +++ b/apps/restconf/restconf_methods.c @@ -496,7 +496,7 @@ api_data_write(clixon_handle h, goto done; } if (namespace == NULL){ - clixon_debug_xml(1, xparent, "%s xparent:", __FUNCTION__); + clixon_debug_xml(CLIXON_DBG_DEFAULT, xparent, "%s xparent:", __FUNCTION__); /* XXX */ } /* Set xmlns="" default namespace attribute (if diff from default) */ diff --git a/apps/restconf/restconf_methods_patch.c b/apps/restconf/restconf_methods_patch.c index abbe0fcf..449f5a81 100644 --- a/apps/restconf/restconf_methods_patch.c +++ b/apps/restconf/restconf_methods_patch.c @@ -635,7 +635,7 @@ yang_patch_do_edit(clixon_handle h, yang_stmt *ybot = NULL; yang_stmt *ymod; - clixon_debug_xml(1, xn, "%s %d xn:", __FUNCTION__, __LINE__); + clixon_debug_xml(CLIXON_DBG_DEFAULT, xn, "%s %d xn:", __FUNCTION__, __LINE__); /* Create cbufs:s */ if ((simple_patch_request_uri = cbuf_new()) == NULL){ clixon_err(OE_UNIX, errno, "cbuf_new"); diff --git a/apps/restconf/restconf_methods_post.c b/apps/restconf/restconf_methods_post.c index b368b302..37007124 100644 --- a/apps/restconf/restconf_methods_post.c +++ b/apps/restconf/restconf_methods_post.c @@ -330,7 +330,7 @@ api_data_post(clixon_handle h, if (restconf_insert_attributes(xdata, qvec) < 0) goto done; #if 1 - clixon_debug_xml(1, xdata, "%s xdata:", __FUNCTION__); + clixon_debug_xml(CLIXON_DBG_DEFAULT, xdata, "%s xdata:", __FUNCTION__); #endif /* Create text buffer for transfer to backend */ @@ -491,7 +491,7 @@ api_operations_post_input(clixon_handle h, * ... */ #if 1 - clixon_debug_xml(1, xdata, "%s xdata:", __FUNCTION__); + clixon_debug_xml(CLIXON_DBG_DEFAULT, xdata, "%s xdata:", __FUNCTION__); #endif /* Validate that exactly only tag */ if ((xinput = xml_child_i_type(xdata, 0, CX_ELMNT)) == NULL || @@ -588,7 +588,7 @@ api_operations_post_output(clixon_handle h, xml_name_set(xoutput, "output"); /* xoutput should now look: 0 */ #if 1 - clixon_debug_xml(1, xoutput, "%s xoutput:", __FUNCTION__); + clixon_debug_xml(CLIXON_DBG_DEFAULT, xoutput, "%s xoutput:", __FUNCTION__); #endif /* Remove original netconf default namespace. Somewhat unsure what "output" belongs to? */ if ((xa = xml_find_type(xoutput, NULL, "xmlns", CX_ATTR)) != NULL) @@ -803,7 +803,7 @@ api_operations_post(clixon_handle h, /* Here xtop is: 42 */ #if 1 - clixon_debug_xml(1, xtop, "%s 5. Translate input args:", __FUNCTION__); + clixon_debug_xml(CLIXON_DBG_DEFAULT, xtop, "%s 5. Translate input args:", __FUNCTION__); #endif /* 6. Validate outgoing RPC and fill in defaults */ if ((ret = xml_bind_yang_rpc(h, xtop, yspec, &xerr)) < 0) /* */ @@ -824,7 +824,7 @@ api_operations_post(clixon_handle h, * 4299 */ #if 0 - clixon_debug_xml(1, xtop, "%s 6. Validate and defaults:", __FUNCTION__); + clixon_debug_xml(CLIXON_DBG_DEFAULT, xtop, "%s 6. Validate and defaults:", __FUNCTION__); #endif /* 7. Send to RPC handler, either local or backend * Note (1) xtop is xbot is @@ -865,7 +865,7 @@ api_operations_post(clixon_handle h, * 0 */ #if 1 - clixon_debug_xml(1, xret, "%s Receive reply:", __FUNCTION__); + clixon_debug_xml(CLIXON_DBG_DEFAULT, xret, "%s Receive reply:", __FUNCTION__); #endif youtput = yang_find(yrpc, Y_OUTPUT, NULL); if ((ret = api_operations_post_output(h, req, xret, yspec, youtput, namespace, diff --git a/lib/src/clixon_xml_map.c b/lib/src/clixon_xml_map.c index 114a4935..6357735d 100644 --- a/lib/src/clixon_xml_map.c +++ b/lib/src/clixon_xml_map.c @@ -164,7 +164,7 @@ xml2cvec(cxobj *xt, while ((xc = xml_child_each(xt, xc, CX_ELMNT)) != NULL){ name = xml_name(xc); if ((ys = yang_find_datanode(yt, name)) == NULL){ - clixon_debug(0, "%s: yang sanity problem: %s in xml but not present in yang under %s", + clixon_debug(CLIXON_DBG_ALWAYS, "%s: yang sanity problem: %s in xml but not present in yang under %s", __FUNCTION__, name, yang_argument_get(yt)); if ((body = xml_body(xc)) != NULL){ if ((cv = cv_new(CGV_STRING)) == NULL){