//include_lib\system\debug.h /* * LOG 透過常量控制 */ #elif (LOG_MODE == LOG_BY_CONST) #define log_info(format, ...) \ if (LOG_IS_ENABLE(LOG_INFO)) \ printf("\e[1;47;35m" "[%s %d]:" "log_info(format, ...)" "\e[0m",__FUNCTION__,__LINE__);log_print(__LOG_INFO,NULL,"[Info]: " _LOG_TAG format "\r\n", ## __VA_ARGS__) //apps\hid\include\app_config.h /*********************************************************************************/ //字色 亮色 常用色(亮色;灰底) #define RED "\e[1;47;31m"//紅 #define GREEN "\e[1;47;32m"//綠 #define BLUE "\e[1;47;34m"//藍 #define YELLOW "\e[1;47;33m"//黃 #define CYAN "\e[1;47;36m"//青 #define PURPLE "\e[1;47;35m"//紫 #define BLACK "\e[1;47;30m"//黑 #define WHITE "\e[1;47;37m"//白 //字色 暗色 #define D_RED "\e[0;31m"//暗紅 #define D_GREEN "\e[0;32m"// #define D_BLUE "\e[0;34m"// #define D_YELLOW "\e[0;33m"// #define D_CYAN "\e[0;36m"// #define D_PURPLE "\e[0;35m"// #define D_BLACK "\e[0;30m"// #define D_WHITE "\e[0;37m"//暗白(灰) //底色 #define BG_RED "\e[1;41m" #define BG_GREEN "\e[1;42m" #define BG_BLUE "\e[1;44m" #define BG_YELLOW "\e[1;43m" #define BG_CYAN "\e[1;46m" #define BG_PURPLE "\e[1;45m" #define BG_WHITE "\e[1;47m" #define BG_GREEN2 "\e[1;48m" //強調 #define END_ATTR "\e[0m" #define BOLD "\e[1m" // #define UNDERLINE "\e[4m" // #define BLINK "\e[5m" // #define REVERSE "\e[7m" // #define HIDE "\e[8m" // #define CLEAR "\e[2J" //清理 #define CLRLINE "\r\e[K" //捲曲 /*********************************************************************************/ // 顏色 字串 強調 結束屬性, 換行 #define printfr(x ,...) (printf(RED "[%s %d]:" x END_ATTR,__FUNCTION__,__LINE__,##__VA_ARGS__)) #define printfg(x ,...) (printf(GREEN "[%s %d]:" x END_ATTR,__FUNCTION__,__LINE__,##__VA_ARGS__)) #define printfb(x ,...) (printf(BLUE "[%s %d]:" x END_ATTR,__FUNCTION__,__LINE__,##__VA_ARGS__)) #define printfy(x ,...) (printf(YELLOW "[%s %d]:" x END_ATTR,__FUNCTION__,__LINE__,##__VA_ARGS__)) #define printfc(x ,...) (printf(CYAN "[%s %d]:" x END_ATTR,__FUNCTION__,__LINE__,##__VA_ARGS__)) #define printfp(x ,...) (printf(PURPLE "[%s %d]:" x END_ATTR,__FUNCTION__,__LINE__,##__VA_ARGS__)) #define printfbl(x ,...) (printf(BLACK "[%s %d]:" x END_ATTR,__FUNCTION__,__LINE__,##__VA_ARGS__)) #define printfw(x ,...) (printf(WHITE "[%s %d]:" x END_ATTR,__FUNCTION__,__LINE__,##__VA_ARGS__)) #define printfg_bo(x ,...) (printf(GREEN "[%s %d]:" x BOLD END_ATTR,__FUNCTION__,__LINE__,##__VA_ARGS__)) #define printfg_un(x ,...) (printf(GREEN "[%s %d]:" x UNDERLINE END_ATTR,__FUNCTION__,__LINE__,##__VA_ARGS__)) #define printfg_bl(x ,...) (printf(GREEN "[%s %d]:" x BLINK END_ATTR,__FUNCTION__,__LINE__,##__VA_ARGS__)) #define printfg_rv(x ,...) (printf(GREEN "[%s %d]:" x REVERSE END_ATTR,__FUNCTION__,__LINE__,##__VA_ARGS__)) /*********************************************************************************/
設定
效果圖