#cat aa.c
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#define DEBUG
#ifdef DEBUG
static int log_debug(const char *format, ...)
{
    va_list argPtr;
    int     count;

    va_start(argPtr, format);                  /*  获取可变参数列表  */
    fflush(stdout);                            /*  强制刷新输出缓冲区  */
    count = vfprintf(stderr, format, argPtr);  /*  将信息输出到标准出错流设备  */
    va_end(argPtr);                            /*  可变参数列表结束  */
}
#else
static inline int log_debug(const char *format, ...)
{

}
#endif

int main() {
	int a = 1 ;
	char s1[10]="muahao";
	log_debug("hello:%d,%s\n",a, s1);
	log_debug("------hekii\n");
	return 0;
}

相关文章:

  • 2021-06-20
  • 2021-08-26
  • 2021-09-08
  • 2021-11-14
  • 2021-11-23
  • 2022-01-02
  • 2021-09-04
猜你喜欢
  • 2021-08-30
  • 2022-12-23
  • 2021-04-29
  • 2021-12-28
  • 2021-10-14
  • 2022-01-21
  • 2021-10-04
相关资源
相似解决方案