中国开发网: 论坛: 程序员情感CBD: 贴子 68186
haitao
#define log0strs(d,a...) commlogStrs(d,a...)还是报错(VC6),想做得好一点就这么难
#ifndef _LOG_H
#define _LOG_H

#include "CommLog.h"
/*
0冗余信息
1调试信息
2运行信息
3变化信息
4警告信息
5错误信息
6异常信息
7失败信息
*/

#define loglevel0
#define loglevel1
#define loglevel2
#define loglevel3
#define loglevel4
#define loglevel5
#define loglevel6
#define loglevel7

/*
inline int log0str(const char* str,char withdate=-1)
{
#ifndef loglevel0
return 0;
#else
return commlogStr(str,withdate);
#endif
}
inline int log0str2(const char* str,const char* str2,char withdate=-1)
{
#ifndef loglevel0
return 0;
#else
return commlogStr2(str,str2,withdate);
#endif
}
inline int log0int(const char* str,const int d,char withdate=-1)
{
#ifndef loglevel0
return 0;
#else
return commlogInt(str,d,withdate);
#endif
}
inline int log0strs(char withdate=-1,...)
{
#ifndef loglevel0
return 0;
#else
return commlogStrs(withdate,...);
#endif
}
*/

//extern int commlogStr(const char* str,char withdate=-1);
//extern int commlogStr2(const char* str,const char* str2,char withdate=-1);
//extern int commlogStrs(char withdate=-1,...);
//extern int commlogInt(const char* str,const int d,char withdate=-1);


#if defined(loglevel0) //被指定需要输出日志
#define log0str(a) commlogStr(a)
#define log0int(a,b) commlogInt(a,b)
#define log0str2(a,b) commlogStr2(a,b)
#define log0strs(d,a...) commlogStrs(d,##a...)
#define log0str(a,d) commlogStr(a,d)
#define log0int(a,b,d) commlogInt(a,b,d)
#define log0str2(a,b,d) commlogStr2(a,b,d)
#else //被指定不需要输出日志
#define log0str(a)
#define log0int(a)
#define log0str2(a,b)
#define log0strs(d,a...)
#define log0str(a,d)
#define log0int(a,b,d)
#define log0str2(a,b,d)
#endif


#endif //_LOG_H
我的blog:http://szhaitao.blog.hexun.com & http://www.hoolee.com/user/haitao
--以上均为泛泛之谈--
不尽牛人滚滚来,无边硬伤纷纷现 人在江湖(出来的),哪能不挨刀(总归是要的)
网络对话,歧义纷生;你以为明白了对方的话,其实呢?

您所在的IP暂时不能使用低版本的QQ,请到:http://im.qq.com/下载安装最新版的QQ,感谢您对QQ的支持和使用

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录