C++ Foundation —— (33) C++的变长参数宏 (Not translated)
»
宏定义实现是否输出日志:

man 3 printf 查看printf库函数用法

log.h声明:
void printf_nothing(const char *format, ...);
//#define LOG(...) printf(__VA_ARGS__)
#define LOG(...) printf_nothing(__VA_ARGS__)

log.c定义:
#include "log.h"
void printf_nothing(const char *format, ...){
}

日志打印使用:LOG("Loging:::a:%d\n", a);

«
--Alex.Zhang
--www.v-signon.com Learningers Co-Encouraged
Back
Personal Art: www.up-task.com Unit: Individual
中文 Русский 京ICP备19038994号-2
If the content on this website infringes upon your any rights, please contact me at 1307776259@qq.com for removal