Use the following methods to print the function name, the current line number, and speed up the debugging process
After supporting printf, you can use the following macro definition instead of printf
#define APP_ERROR(fmt, ...) printf("[ERROR][%s,%d]: " fmt "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
#define APP_TRACE(fmt, ...) printf("[TRACE][%s,%d]: " fmt "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
#define APP_DEBUG(fmt, ...) printf("[DEBUG][%s,%d]: " fmt "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
The effect is as follows