summaryrefslogtreecommitdiff
path: root/lib/imsg-buffer.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2018-03-09 12:07:25 -0500
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-03-12 11:17:02 -0400
commit688818844fe662dea093082c2717481779319f43 (patch)
treedb9387109c39e480d2df960d9a38ac1444708b0a /lib/imsg-buffer.c
parentaea03ad6e8198a91578f550cb0c835020e673031 (diff)
lib: add convenience debugging macros
* Add DEBUG*() macros This set of macros allows you to write printf-like debugging lines that automatically check whether a debug is on before printing. This should eliminate the need for explicit checks in simple cases. For example: if (SUCH_AND_SUCH_DEBUG_IS_ON) { zlog_warn(...); } Becomes: DEBUG(warn, such_and_such, ...); Or, equivalently, DEBUGE(such_and_such, ...); The levels passed to DEBUG are expanded into the names of zlog_* functions, so the same zlog levels are available. There's also a set of macros that have the level built into them; DEBUGE for errors, DEBUGW for warnings, etc. Good for brevity. * Add singular setting macros Change the 'SET' macros to accept a boolean indicating whether the provided bits should be set or unset, and map on/off macros to them. Helps condense code where you already have a boolean condition that tells you what you want to do as you can avoid writing the branch. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/imsg-buffer.c')
0 files changed, 0 insertions, 0 deletions