Symbolic and combined debug names in cmd-line of all applications
New debug levels: BACKEND, CLI, NETCONF,RESTCONF, SNMP, STREAM
This commit is contained in:
parent
86f251f343
commit
4e3bd6fbdd
39 changed files with 564 additions and 416 deletions
|
|
@ -146,7 +146,7 @@ ce_event_cb(clixon_handle h,
|
|||
struct client_entry *ce = (struct client_entry *)arg;
|
||||
cbuf *cbce = NULL;
|
||||
|
||||
clixon_debug(CLIXON_DBG_CLIENT, "op:%d", op);
|
||||
clixon_debug(CLIXON_DBG_BACKEND, "op:%d", op);
|
||||
switch (op){
|
||||
case 1:
|
||||
/* Risk of recursion here */
|
||||
|
|
@ -282,7 +282,7 @@ backend_monitoring_state_get(clixon_handle h,
|
|||
goto fail;
|
||||
retval = 1;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_CLIENT, "retval:%d", retval);
|
||||
clixon_debug(CLIXON_DBG_BACKEND, "retval:%d", retval);
|
||||
if (cb)
|
||||
cbuf_free(cb);
|
||||
return retval;
|
||||
|
|
@ -321,10 +321,10 @@ backend_client_rm(clixon_handle h,
|
|||
if (if_feature(yspec, "ietf-netconf", "confirmed-commit")) {
|
||||
if (confirmed_commit_state_get(h) == EPHEMERAL) {
|
||||
/* See if this client is the origin */
|
||||
clixon_debug(CLIXON_DBG_CLIENT, "session_id: %u, confirmed_commit.session_id: %u", ce->ce_id, confirmed_commit_session_id_get(h));
|
||||
clixon_debug(CLIXON_DBG_BACKEND, "session_id: %u, confirmed_commit.session_id: %u", ce->ce_id, confirmed_commit_session_id_get(h));
|
||||
|
||||
if (myid == confirmed_commit_session_id_get(h)) {
|
||||
clixon_debug(CLIXON_DBG_CLIENT, "ok, rolling back");
|
||||
clixon_debug(CLIXON_DBG_BACKEND, "ok, rolling back");
|
||||
clixon_log(h, LOG_NOTICE, "a client with an active ephemeral confirmed-commit has disconnected; rolling back");
|
||||
|
||||
/* do_rollback errors are logged internally and there is no client to report errors to, so errors are
|
||||
|
|
@ -336,7 +336,7 @@ backend_client_rm(clixon_handle h,
|
|||
}
|
||||
}
|
||||
|
||||
clixon_debug(CLIXON_DBG_CLIENT, "");
|
||||
clixon_debug(CLIXON_DBG_BACKEND, "");
|
||||
/* for all streams: XXX better to do it top-level? */
|
||||
stream_ss_delete_all(h, ce_event_cb, (void*)ce);
|
||||
c0 = backend_client_list(h);
|
||||
|
|
@ -378,7 +378,7 @@ clixon_stats_datastore_get(clixon_handle h,
|
|||
size_t sz = 0;
|
||||
cxobj *xn = NULL;
|
||||
|
||||
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "%s", dbname);
|
||||
clixon_debug(CLIXON_DBG_BACKEND | CLIXON_DBG_DETAIL, "%s", dbname);
|
||||
/* This is the db cache */
|
||||
if ((xt = xmldb_cache_get(h, dbname)) == NULL){
|
||||
/* Trigger cache if no exist (trick to ensure cache is present) */
|
||||
|
|
@ -655,7 +655,7 @@ from_client_edit_config(clixon_handle h,
|
|||
xml_free(xret);
|
||||
if (cbx)
|
||||
cbuf_free(cbx);
|
||||
clixon_debug(CLIXON_DBG_CLIENT, "done cbret:%s", cbuf_get(cbret));
|
||||
clixon_debug(CLIXON_DBG_BACKEND, "done cbret:%s", cbuf_get(cbret));
|
||||
return retval;
|
||||
} /* from_client_edit_config */
|
||||
|
||||
|
|
@ -1584,7 +1584,7 @@ from_client_msg(clixon_handle h,
|
|||
int nr = 0;
|
||||
cbuf *cbce = NULL;
|
||||
|
||||
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "");
|
||||
clixon_debug(CLIXON_DBG_BACKEND | CLIXON_DBG_DETAIL, "");
|
||||
yspec = clicon_dbspec_yang(h);
|
||||
/* Return netconf message. Should be filled in by the dispatch(sub) functions
|
||||
* as wither rpc-error or by positive response.
|
||||
|
|
@ -1633,7 +1633,7 @@ from_client_msg(clixon_handle h,
|
|||
if (op_id != 0 && ce->ce_id != op_id && strcmp(rpcname, "create-subscription")){
|
||||
client_entry *ce0;
|
||||
|
||||
clixon_debug(CLIXON_DBG_CLIENT, "Warning: incoming session-id:%u does not match ce_id:%u on socket: %d", op_id, ce->ce_id, ce->ce_s);
|
||||
clixon_debug(CLIXON_DBG_BACKEND, "Warning: incoming session-id:%u does not match ce_id:%u on socket: %d", op_id, ce->ce_id, ce->ce_s);
|
||||
/* Copy transport from orig client-entry */
|
||||
if (ce->ce_transport == NULL &&
|
||||
(ce0 = ce_find_byid(backend_client_list(h), op_id)) != NULL &&
|
||||
|
|
@ -1720,7 +1720,7 @@ from_client_msg(clixon_handle h,
|
|||
goto done;
|
||||
}
|
||||
module = yang_argument_get(ymod);
|
||||
clixon_debug(CLIXON_DBG_CLIENT, "module:%s rpc:%s ce_id:%u s:%d", module,
|
||||
clixon_debug(CLIXON_DBG_BACKEND, "module:%s rpc:%s ce_id:%u s:%d", module,
|
||||
rpc, ce->ce_id, ce->ce_s);
|
||||
/* Pre-NACM access step */
|
||||
xnacm = NULL;
|
||||
|
|
@ -1812,7 +1812,7 @@ from_client_msg(clixon_handle h,
|
|||
// ok:
|
||||
retval = 0;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "retval:%d", retval);
|
||||
clixon_debug(CLIXON_DBG_BACKEND | CLIXON_DBG_DETAIL, "retval:%d", retval);
|
||||
if (xnacm){
|
||||
xml_free(xnacm);
|
||||
if (clicon_nacm_cache_set(h, NULL) < 0)
|
||||
|
|
@ -1830,7 +1830,7 @@ from_client_msg(clixon_handle h,
|
|||
if (retval < 0 && clixon_err_category() < 0)
|
||||
clixon_log(h, LOG_NOTICE, "%s: Internal error: No clixon_err call on RPC error (message: %s)",
|
||||
__FUNCTION__, rpc?rpc:"");
|
||||
// clixon_debug(CLIXON_DBG_CLIENT, "retval:%d", retval);
|
||||
// clixon_debug(CLIXON_DBG_BACKEND, "retval:%d", retval);
|
||||
return retval;// -1 here terminates backend
|
||||
}
|
||||
|
||||
|
|
@ -1853,7 +1853,7 @@ from_client(int s,
|
|||
int eof = 0;
|
||||
cbuf *cbce = NULL;
|
||||
|
||||
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "");
|
||||
clixon_debug(CLIXON_DBG_BACKEND | CLIXON_DBG_DETAIL, "");
|
||||
if (s != ce->ce_s){
|
||||
clixon_err(OE_NETCONF, EINVAL, "Internal error: s != ce->ce_s");
|
||||
goto done;
|
||||
|
|
@ -1871,7 +1871,7 @@ from_client(int s,
|
|||
goto done;
|
||||
retval = 0;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_CLIENT | CLIXON_DBG_DETAIL, "retval:%d", retval);
|
||||
clixon_debug(CLIXON_DBG_BACKEND | CLIXON_DBG_DETAIL, "retval:%d", retval);
|
||||
if (cbce)
|
||||
cbuf_free(cbce);
|
||||
if (msg)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue