Usage recipe 0. in .c file
- #define NET_TEST_MODULE_NAME name_of_net_test_module
- #include "net/test/debug.h"
- Use LOGD() macro for regular debug output.
- #undef NET_TEST_MODULE_NAME in the end of file (or scope in which LOGD() is needed) (because of altogether build mode).
- Enable/disable debug output from any point using LOGD_VAR_NAME(some_module_name) variable (declared using LOGD_VAR_DECLARE(some_module_name)) Debug output is disabled by default.
Macro names used: LOGD, NET_TEST_MODULE_NAME, LOGD_VAR_DECLARE, LOGD_VAR_NAME
- Note
- Include guards are not needed in this file because LOGD_VAR_NAME(NET_TEST_MODULE_NAME) variable should be defined for each module that includes this file.
◆ LOGD
Value:do { \
} while (0)
#define LOGD_VAR_NAME(module_name)
#define NET_TEST_MODULE_NAME
Definition at line 72 of file debug.h.
◆ LOGD_VAR_DECLARE
#define LOGD_VAR_DECLARE |
( |
|
module_name | ) |
extern bool LOGD_VAR_NAME(module_name); |
◆ LOGD_VAR_NAME
#define LOGD_VAR_NAME |
( |
|
module_name | ) |
M0_CAT(m0_net_test_logd_, module_name) |
◆ LOGD_VAR_NAME()
There is one variable per inclusion of this file. It is useful to enable/disable module debug messages from any point in code.
◆ M0_BASSERT()
M0_BASSERT |
( |
"NET_TEST_MODULE_NAME should be defined " "before including debug.h" |
= =NULL | ) |
|