标签:end mes lis log va_arg div iostream fprintf define
#include<iostream>
using namespace std;
#define LOG(str) printf("[%s][%s](%d)[%s][%s]:%s",__FILE__, __func__, __LINE__,__DATE__, __TIME__, str)
int main()
{
LOG("log");
return 0;
}
#include <stdio.h>
#define LOG_DEBUG "DEBUG"
#define LOG_TRACE "TRACE"
#define LOG_ERROR "ERROR"
#define LOG_INFO "INFOR"
#define LOG_CRIT "CRTCL"
#define LOG(level, format, ...) do { fprintf(stderr, "[%s|%s@%s:%d] " format "\n", level, __func__, __FILE__, __LINE__, ##__VA_ARGS__ ); } while (0)
int main()
{
LOG(LOG_DEBUG, "a=%d,b=%d,c=%s", 10,20,"end");
return 0;
}
标签:end mes lis log va_arg div iostream fprintf define
原文地址:https://www.cnblogs.com/ims-/p/10952833.html