10#ifndef TR_DEBUG_PRINT_H
11#define TR_DEBUG_PRINT_H
15#define DEBUG_BLACK "\033[30m"
16#define DEBUG_RED "\033[31m"
17#define DEBUG_GREEN "\033[32m"
18#define DEBUG_YELLOW "\033[33m"
19#define DEBUG_BLUE "\033[34m"
20#define DEBUG_MAGENTA "\033[35m"
21#define DEBUG_CYAN "\033[36m"
22#define DEBUG_WHITE "\033[37m"
23#define DEBUG_DEFAULT "\033[39m"
24#define DEBUG_RESET "\033[m"
27#ifndef TR_DEBUG_PRINT_COLOR_ENABLED
28#ifdef TR_DEBUG_PRINT_STACK_ENABLED
29#define TR_DEBUG_PRINT_STACK_COLOR DEBUG_DEFAULT
31#ifdef TR_DEBUG_PRINT_CORE_ENABLED
32#define TR_DEBUG_PRINT_CORE_COLOR DEBUG_DEFAULT
34#ifdef TR_DEBUG_PRINT_APP_ENABLED
35#define TR_DEBUG_PRINT_APP_COLOR DEBUG_DEFAULT
37#ifdef TR_DEBUG_PRINT_ZCL_ENABLED
38#define TR_DEBUG_PRINT_ZCL_COLOR DEBUG_DEFAULT
40#ifdef TR_DEBUG_PRINT_RX_MSGS_ENABLED
41#define TR_DEBUG_PRINT_RX_MSGS_COLOR DEBUG_DEFAULT
56#ifdef TR_DEBUG_PRINT_STACK_ENABLED
57#define tr_stack_printf(...) tr_debug_printf(TR_DEBUG_PRINT_STACK, TR_DEBUG_PRINT_STACK_COLOR, __VA_ARGS__)
58#define tr_stack_println(...) tr_debug_println(TR_DEBUG_PRINT_STACK, TR_DEBUG_PRINT_STACK_COLOR, __VA_ARGS__)
60#define tr_stack_printf(...)
61#define tr_stack_println(...)
64#ifdef TR_DEBUG_PRINT_CORE_ENABLED
65#define tr_core_printf(...) tr_debug_printf(TR_DEBUG_PRINT_CORE, TR_DEBUG_PRINT_CORE_COLOR, __VA_ARGS__)
66#define tr_core_println(...) tr_debug_println(TR_DEBUG_PRINT_CORE, TR_DEBUG_PRINT_CORE_COLOR, __VA_ARGS__)
68#define tr_core_printf(...)
69#define tr_core_println(...)
72#ifdef TR_DEBUG_PRINT_APP_ENABLED
73#define tr_app_printf(...) tr_debug_printf(TR_DEBUG_PRINT_APP, TR_DEBUG_PRINT_APP_COLOR, __VA_ARGS__)
74#define tr_app_println(...) tr_debug_println(TR_DEBUG_PRINT_APP, TR_DEBUG_PRINT_APP_COLOR, __VA_ARGS__)
76#define tr_app_printf(...)
77#define tr_app_println(...)
80#ifdef TR_DEBUG_PRINT_ZCL_ENABLED
81#define tr_zcl_printf(...) tr_debug_printf(TR_DEBUG_PRINT_ZCL, TR_DEBUG_PRINT_ZCL_COLOR, __VA_ARGS__)
82#define tr_zcl_println(...) tr_debug_println(TR_DEBUG_PRINT_ZCL, TR_DEBUG_PRINT_ZCL_COLOR, __VA_ARGS__)
84#define tr_zcl_printf(...)
85#define tr_zcl_println(...)
88#ifdef TR_DEBUG_PRINT_RX_MSGS_ENABLED
89#define tr_rxmsgs_printf(...) tr_debug_printf(TR_DEBUG_PRINT_RX_MSGS, TR_DEBUG_PRINT_RX_MSGS_COLOR, __VA_ARGS__)
90#define tr_rxmsgs_println(...) tr_debug_println(TR_DEBUG_PRINT_RX_MSGS, TR_DEBUG_PRINT_RX_MSGS_COLOR, __VA_ARGS__)
92#define tr_rxmsgs_printf(...)
93#define tr_rxmsgs_println(...)
void tr_disable_print_group(tr_debug_print_group_t group)
disable a print group
zb_uint32_t tr_get_print_group_mask(void)
get the print group mask
void tr_enable_print_group(tr_debug_print_group_t group)
enable a print group
zb_bool_t tr_check_print_group(tr_debug_print_group_t group)
check to see if a print group is enabled
void tr_debug_println(tr_debug_print_group_t group, const char *color, const char *fmt,...)
void tr_debug_printf(tr_debug_print_group_t group, const char *color, const char *fmt,...)
tr_debug_print_group_t
Definition tr_debug_print.h:47
@ TR_DEBUG_PRINT_ZCL
Definition tr_debug_print.h:51
@ TR_DEBUG_PRINT_APP
Definition tr_debug_print.h:50
@ TR_DEBUG_PRINT_CORE
Definition tr_debug_print.h:49
@ TR_DEBUG_PRINT_ALL
Definition tr_debug_print.h:53
@ TR_DEBUG_PRINT_RX_MSGS
Definition tr_debug_print.h:52
@ TR_DEBUG_PRINT_STACK
Definition tr_debug_print.h:48