summaryrefslogtreecommitdiffstats
path: root/lib/mgmt_be_client.h
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2023-06-09 22:54:54 +0200
committerChristian Hopps <chopps@labn.net>2023-06-13 10:11:29 +0200
commit96f9e7853bad7e21676f2eb126a915561e6c8dce (patch)
treeb902eda89b5fd78543bd24c494e18a3c0946ca11 /lib/mgmt_be_client.h
parentMerge pull request #13763 from LabNConsulting/mgmtd/simplify (diff)
downloadfrr-96f9e7853bad7e21676f2eb126a915561e6c8dce.tar.xz
frr-96f9e7853bad7e21676f2eb126a915561e6c8dce.zip
lib: mgmtd: improvements in logging and commentary
- log names of datastores not numbers - improve logging for mgmt_msg_read - Rather than use a bool, instead store the pending const string name of the command being run that has postponed the CLI. This adds some nice information to the logging when enabled. Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'lib/mgmt_be_client.h')
-rw-r--r--lib/mgmt_be_client.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/mgmt_be_client.h b/lib/mgmt_be_client.h
index 4d8a1f51a..4ad5ca595 100644
--- a/lib/mgmt_be_client.h
+++ b/lib/mgmt_be_client.h
@@ -131,10 +131,20 @@ mgmt_be_client_name2id(const char *name)
return MGMTD_BE_CLIENT_ID_MAX;
}
+extern struct debug mgmt_dbg_be_client;
+
/***************************************************************
* API prototypes
***************************************************************/
+#define MGMTD_BE_CLIENT_DBG(fmt, ...) \
+ DEBUGD(&mgmt_dbg_be_client, "BE-CLIENT: %s: " fmt, __func__, \
+ ##__VA_ARGS__)
+#define MGMTD_BE_CLIENT_ERR(fmt, ...) \
+ zlog_err("BE-CLIENT: %s: ERROR: " fmt, __func__, ##__VA_ARGS__)
+#define MGMTD_DBG_BE_CLIENT_CHECK() \
+ DEBUG_MODE_CHECK(&mgmt_dbg_be_client, DEBUG_MODE_ALL)
+
/**
* Create backend client and connect to MGMTD.
*