Move debug msg to msg+detail, only msg length in debug level msg

Move log warning of namespace mismatch to debug
This commit is contained in:
Olof hagsand 2024-09-27 14:45:08 +02:00
parent 1994a405dd
commit ba40f5a929
4 changed files with 36 additions and 16 deletions

View file

@ -476,7 +476,8 @@ netconf_input_cb(int s,
cbmsg = NULL; cbmsg = NULL;
break; break;
} }
clixon_debug(CLIXON_DBG_MSG, "Recv ext: %s", cbuf_get(cbmsg)); clixon_debug(CLIXON_DBG_MSG, "Recv ext len: %lu", cbuf_len(cbmsg));
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "Recv ext: %s", cbuf_get(cbmsg));
if ((ret = netconf_input_frame2(cbmsg, YB_RPC, yspec, &xtop, &xerr)) < 0) if ((ret = netconf_input_frame2(cbmsg, YB_RPC, yspec, &xtop, &xerr)) < 0)
goto done; goto done;
cbuf_reset(cbmsg); cbuf_reset(cbmsg);

View file

@ -2194,7 +2194,8 @@ netconf_output(int s,
char *buf = cbuf_get(cb); char *buf = cbuf_get(cb);
int len = cbuf_len(cb); int len = cbuf_len(cb);
clixon_debug(CLIXON_DBG_MSG, "Send ext: %s", cbuf_get(cb)); clixon_debug(CLIXON_DBG_MSG, "Send ext len: %lu", cbuf_len(cb));
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "Send ext: %s", cbuf_get(cb));
#if 0 // Extra sanity check for debugging #if 0 // Extra sanity check for debugging
{ {
cxobj *xt = NULL; cxobj *xt = NULL;

View file

@ -353,11 +353,15 @@ clixon_msg_send(int s,
{ {
int retval = -1; int retval = -1;
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "send msg len=%lu", cbuf_len(cb)); if (descr){
if (descr) clixon_debug(CLIXON_DBG_MSG, "Send [%s] len: %lu", descr, cbuf_len(cb));
clixon_debug(CLIXON_DBG_MSG, "Send [%s]: %s", descr, cbuf_get(cb)); clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "Send [%s] %s", descr, cbuf_get(cb));
else }
clixon_debug(CLIXON_DBG_MSG, "Send: %s", cbuf_get(cb)); else{
clixon_debug(CLIXON_DBG_MSG, "Send len: %lu", cbuf_len(cb));
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "Send %s", cbuf_get(cb));
}
if (atomicio((ssize_t (*)(int, void *, size_t))write, if (atomicio((ssize_t (*)(int, void *, size_t))write,
s, cbuf_get(cb), cbuf_len(cb)) < 0){ s, cbuf_get(cb), cbuf_len(cb)) < 0){
clixon_err(OE_CFG, errno, "atomicio"); clixon_err(OE_CFG, errno, "atomicio");
@ -428,10 +432,15 @@ clixon_msg_rcv10(int s,
clixon_debug(CLIXON_DBG_MSG, "Recv: EOF"); clixon_debug(CLIXON_DBG_MSG, "Recv: EOF");
} }
else { else {
if (descr) if (descr){
clixon_debug(CLIXON_DBG_MSG, "Recv [%s]: %s", descr, cbuf_get(cb)); clixon_debug(CLIXON_DBG_MSG, "Recv [%s] len: %lu", descr, cbuf_len(cb));
else clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "Recv [%s]: %s", descr, cbuf_get(cb));
clixon_debug(CLIXON_DBG_MSG, "Recv: %s", cbuf_get(cb)); }
else{
clixon_debug(CLIXON_DBG_MSG, "Recv len: %lu", cbuf_len(cb));
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "Recv: %s", cbuf_get(cb));
}
} }
retval = 0; retval = 0;
done: done:
@ -602,10 +611,15 @@ clixon_msg_rcv11(int s,
clixon_debug(CLIXON_DBG_MSG, "Recv: EOF"); clixon_debug(CLIXON_DBG_MSG, "Recv: EOF");
} }
else { else {
if (descr) if (descr){
clixon_debug(CLIXON_DBG_MSG, "Recv [%s]: %s", descr, cbuf_get(cbmsg)); clixon_debug(CLIXON_DBG_MSG, "Recv [%s] len: %lu", descr, cbuf_len(cbmsg));
else clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "Recv [%s]: %s", descr, cbuf_get(cbmsg));
clixon_debug(CLIXON_DBG_MSG, "Recv: %s", cbuf_get(cbmsg)); }
else{
clixon_debug(CLIXON_DBG_MSG, "Recv len: %lu", cbuf_len(cbmsg));
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "Recv: %s", cbuf_get(cbmsg));
}
} }
if (cb){ if (cb){
*cb = cbmsg; *cb = cbmsg;
@ -613,7 +627,7 @@ clixon_msg_rcv11(int s,
} }
retval = 0; retval = 0;
done: done:
clixon_debug(CLIXON_DBG_MSG|CLIXON_DBG_DETAIL, "%s done", __FUNCTION__); clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "%s done", __FUNCTION__);
if (intr){ if (intr){
if (clixon_signal_restore(&oldsigset, oldsigaction) < 0) if (clixon_signal_restore(&oldsigset, oldsigaction) < 0)
goto done; goto done;

View file

@ -911,7 +911,11 @@ yang_lib2yspec(clixon_handle h,
(ymod = yang_find(yspec, Y_MODULE, name)) != NULL && (ymod = yang_find(yspec, Y_MODULE, name)) != NULL &&
(ns2 = yang_find_mynamespace(ymod)) != NULL && (ns2 = yang_find_mynamespace(ymod)) != NULL &&
strcmp(ns, ns2) != 0) { strcmp(ns, ns2) != 0) {
#if 1
clixon_debug(CLIXON_DBG_YANG, "Mount:%s module %s namespace mismatch %s announced vs %s in loaded module", mntpnt, name, ns, ns2);
#else
clixon_log(h, LOG_WARNING, "Mount:%s module %s namespace mismatch %s announced vs %s in loaded module", mntpnt, name, ns, ns2); clixon_log(h, LOG_WARNING, "Mount:%s module %s namespace mismatch %s announced vs %s in loaded module", mntpnt, name, ns, ns2);
#endif
} }
} }
#ifdef YANG_SCHEMA_MOUNT_YANG_LIB_FORCE #ifdef YANG_SCHEMA_MOUNT_YANG_LIB_FORCE