summaryrefslogtreecommitdiff
path: root/lib/mgmt_be_client.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2024-03-26 16:54:54 +0200
committerMark Stapp <mjs@cisco.com>2024-08-27 09:53:02 -0400
commit5dac6961540422a1ca139fae8c5ea9e5a437c4ba (patch)
tree3ff27afc04b9605f832c747b82449b58d5aa5455 /lib/mgmt_be_client.c
parent1797b7eefc730bb4f5aec08f130861650c61dd97 (diff)
lib: rework debug init
The debug library allows to register a `debug_set_all` callback which should enable all debugs in a daemon. This callback is implemented exactly the same in each daemon. Instead of duplicating the code, rework the lib to allow registration of each debug type, and implement the common code only once in the lib. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'lib/mgmt_be_client.c')
-rw-r--r--lib/mgmt_be_client.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/mgmt_be_client.c b/lib/mgmt_be_client.c
index 49879f3f53..ef87b023a1 100644
--- a/lib/mgmt_be_client.c
+++ b/lib/mgmt_be_client.c
@@ -1272,10 +1272,6 @@ void mgmt_debug_be_client_show_debug(struct vty *vty)
vty_out(vty, "debug mgmt client backend\n");
}
-static struct debug_callbacks mgmt_dbg_be_client_cbs = {
- .debug_set_all = mgmt_debug_client_be_set
-};
-
static struct cmd_node mgmt_dbg_node = {
.name = "debug mgmt client backend",
.node = MGMT_BE_DEBUG_NODE,
@@ -1328,7 +1324,8 @@ struct mgmt_be_client *mgmt_be_client_create(const char *client_name,
void mgmt_be_client_lib_vty_init(void)
{
- debug_init(&mgmt_dbg_be_client_cbs);
+ debug_install(&mgmt_dbg_be_client);
+
install_node(&mgmt_dbg_node);
install_element(ENABLE_NODE, &debug_mgmt_client_be_cmd);
install_element(CONFIG_NODE, &debug_mgmt_client_be_cmd);