log4ce_cxx 嵌入日志源代码
ce或嵌入式设备日志打印源代码:功能强大,代码简洁 class Log4ce_cxx { public: /************************************************************************/ /* lpcsLogFile:日志全路径文件名,默认:\Temp\debugInfo.log*/ /************************************************************************/ Log4ce_cxx(LPCWSTR lpcsLogFile=_T("")); ~Log4ce_cxx(void); /************************************************************************/ /* 初始化日志文件,设置文件大小,值为0表示无限制,单位:KB */ /************************************************************************/ bool Initilize(DWORD fileSize=0); void DeInitilize(); /************************************************************************/ /* 是否输出当前线程的ID */ /************************************************************************/ void SetWriteThreadID(bool isWriteThrdID); /************************************************************************/ /* 设置日志等级,小于当前等级的日志不输出 */ /************************************************************************/ void SetLogLevel( const LOG_LEVEL loglevel); /************************************************************************/ /* 写日志,使用方法类似print 如:WriteLog(_T("%s, %d"), _T("输出日志"), 1234) */ /************************************************************************/ void WriteLog( const LPCWSTR lpcsFormat, ... ); void WriteTrace( const LPCWSTR lpcsFormat, ... ); void WriteInfo( const LPCWSTR lpcsFormat, ... ); void WriteWarning( const LPCWSTR lpcsFormat, ... ); void WriteError( const LPCWSTR lpcsFormat, ... ); void WriteFatal( const LPCWSTR lpcsFormat, ... ); /************************************************************************/ /* 写Byte数组 logLevel:日志等级 title:日志标题 len:Byte数据的长度 lpBytes:Byte数据 */ /************************************************************************/ void WriteBytes( LOG_LEVEL logLevel,const TCHAR *title, const int len, const char* lpBytes ); };
- 1
- mmCAtE2013-03-01呃,似乎Apache血统不是很纯的说
- 粉丝: 0
- 资源: 31
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助