一、common.h
#ifdef DEBUG
#define DEBUG_ERROR_POSITION printf("Error:[file %s],[line %d],[function %s]\r\n", __FILE__, __LINE__, __func__)
#define DEBUG_FUNC_START printf("FUNC:[ %s ] start!\r\n", __func__)
#define DEBUG_FUNC_END printf("FUNC:[ %s ] end!\r\n", __func__)
#else
#define DEBUG_ERROR_POSITION
#define DEBUG_FUNC_START
#define DEBUG_FUNC_END
#endif
#ifdef DEBUG
#define DEBUG_INFO(format, ...) printf(format, ##__VA_ARGS__)
#else
#define DEBUG_INFO(format, ...)
#endif
#ifdef DEBUG
#define DEBUG_FUNC(format, ...) printf(format, ##__VA_ARGS__)
#else
#define DEBUG_FUNC(format, ...)
#endif
#define LOG printf