/**
* @file debug_print.c
* @brief 打印头文件
* @author lch (lch_work@foxmail.com)
* @version 1.0
* @date 20251022
*
* @copyright Copyright (c) 2025 by OLE, All Rights Reserved.
*
* @par 修改日志:
*
* | Date | Version | Author | Description
* |
|---|
| 20251022 | 1.0 | lch | 内容
* |
*/
#ifndef DEF_DEBUG_PRINT_H
#define DEF_DEBUG_PRINT_H
/***** 宏定义 *****/
#define DP_COLOR_NONE "\033[0m"
#define DP_COLOR_RED "\033[31m"
#define DP_COLOR_GREEN "\033[32m"
#define DP_COLOR_YELLOW "\033[33m"
#define DP_COLOR_BLUE "\033[34m"
#define DP_COLOR_PURPLE "\033[35m" // 紫色
#define DP_COLOR_WATHET "\033[36m" // 浅蓝
#define DP_COLOR_WHITE "\033[37m"
/* 信息提示 nt整行不带[tag] h只有[tag]显示浅蓝色 n[tag]显示为浅蓝色内容为蓝色 a[tag]整行为浅蓝色 */
#define dp_info_nt(fmt, args...) \
printf(DP_COLOR_WATHET fmt DP_COLOR_NONE "\r\n", ##args)
#define dp_info_h_s(fmt, args...) \
printf(DP_COLOR_WATHET "[INFO] " DP_COLOR_NONE fmt "\r\n", ##args)
#define dp_info_h_c(fmt, args...) \
printf(DP_COLOR_WATHET "[INFO][%s:%d] " DP_COLOR_NONE fmt "\r\n", __func__, __LINE__, ##args)
#define dp_info_n_s(fmt, args...) \
printf(DP_COLOR_WATHET "[INFO] " DP_COLOR_NONE DP_COLOR_BLUE fmt DP_COLOR_NONE "\r\n", ##args)
#define dp_info_n_c(fmt, args...) \
printf(DP_COLOR_WATHET "[INFO][%s:%d] " DP_COLOR_NONE DP_COLOR_BLUE fmt DP_COLOR_NONE "\r\n", __func__, __LINE__, ##args)
#define dp_info_a_s(fmt, args...) \
printf(DP_COLOR_WATHET "[INFO] " fmt DP_COLOR_NONE "\r\n", ##args)
#define dp_info_a_c(fmt, args...) \
printf(DP_COLOR_WATHET "[INFO][%s:%d] " fmt DP_COLOR_NONE "\r\n", __func__, __LINE__, ##args)
/* 错误提示 nt整行不带[tag] h只有[tag]显示红色 n[tag]显示为红色内容为蓝色 a[tag]整行为红色 */
#define dp_err_nt(fmt, args...) \
printf(DP_COLOR_RED fmt DP_COLOR_NONE "\r\n", ##args)
#define dp_err_h_s(fmt, args...) \
printf(DP_COLOR_RED "[ERR] " DP_COLOR_NONE fmt "\r\n", ##args)
#define dp_err_h_c(fmt, args...) \
printf(DP_COLOR_RED "[ERR][%s:%d] " DP_COLOR_NONE fmt "\r\n", __func__, __LINE__, ##args)
#define dp_err_n_s(fmt, args...) \
printf(DP_COLOR_RED "[ERR] " DP_COLOR_NONE DP_COLOR_BLUE fmt DP_COLOR_NONE "\r\n", ##args)
#define dp_err_n_c(fmt, args...) \
printf(DP_COLOR_RED "[ERR][%s:%d] " DP_COLOR_NONE DP_COLOR_BLUE fmt DP_COLOR_NONE "\r\n", __func__, __LINE__, ##args)
#define dp_err_a_s(fmt, args...) \
printf(DP_COLOR_RED "[ERR] " fmt DP_COLOR_NONE "\r\n", ##args)
#define dp_err_a_c(fmt, args...) \
printf(DP_COLOR_RED "[ERR][%s:%d] " fmt DP_COLOR_NONE "\r\n", __func__, __LINE__, ##args)
#define dp_info_nt_rt(fmt, args...) \
rt_printf(DP_COLOR_WATHET fmt DP_COLOR_NONE "\r\n", ##args)
#define dp_err_nt_rt(fmt, args...) \
rt_printf(DP_COLOR_RED fmt DP_COLOR_NONE "\r\n", ##args)
#define dp_err_n_s_rt(fmt, args...) \
rt_printf(DP_COLOR_RED "[ERR] " DP_COLOR_NONE DP_COLOR_BLUE fmt DP_COLOR_NONE "\r\n", ##args)
#define dp_err_n_c_rt(fmt, args...) \
rt_printf(DP_COLOR_RED "[ERR][%s:%d] " DP_COLOR_NONE DP_COLOR_BLUE fmt DP_COLOR_NONE "\r\n", __func__, __LINE__, ##args)
#define dp_info_nt_pk(fmt, args...) \
printk(DP_COLOR_WATHET fmt DP_COLOR_NONE "\r\n", ##args)
#define dp_err_n_s_pk(fmt, args...) \
printk(DP_COLOR_RED "[ERR] " DP_COLOR_NONE DP_COLOR_BLUE fmt DP_COLOR_NONE "\r\n", ##args)
#define dp_err_n_c_pk(fmt, args...) \
printk(DP_COLOR_RED "[ERR][%s:%d] " DP_COLOR_NONE DP_COLOR_BLUE fmt DP_COLOR_NONE "\r\n", __func__, __LINE__, ##args)
/***** 头文件 *****/
/***** 枚举 *****/
/***** 结构体 *****/
/***** 变量对外声明 *****/
/***** 函数对外声明 *****/
#endif /* end of file */