(定义)
//arnold 20220420 ky_printf_format_time() start
void ky_printf_format_time(){
char format_time[64] = {0};
int ret = ky_get_format_time(format_time, sizeof(format_time));
if(ret == 0){
printf("ky_printf_string_and_format_time get format time failed!\n");
}
printf("[%s]", format_time);
}
//arnold 20220420 ky_printf_format_time() end
#define KY_PRINTF_STRING_AND_FORMAT_TIME ky_printf_format_time();printf
(调用)
KY_PRINTF_STRING_AND_FORMAT_TIME("The program is going to be ended!\n");
int sig = 15;
KY_PRINTF_STRING_AND_FORMAT_TIME("demo_signal_call_back has received signal [%d]\n", sig);
(结果)
[2022-04-20_14-08-50]The program is going to be ended!
[2022-04-20_14-08-50]demo_signal_call_back has received signal [15]
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)