1. 首页
  2. 编程语言
  3. C++ 
  4. log4ce_cxx 嵌入日志源代码

log4ce_cxx 嵌入日志源代码

上传者: 2018-12-15 11:13:11上传 RAR文件 1.58MB 热度 26次
ce或嵌入式设备日志打印源代码:功能强大,代码简洁 class Log4ce_cxx { public: /************************************************************************/ /* lpcsLogFile:日志全路径文件名,默认:\Temp\debugInfo.log*/ /************************************************************************/ Log4ce_cxx(LPCWSTR lpcsLogFile=_T("")); ~Log4ce_cxx(void); /************************************************************************/ /* 初始化日志文件,设置文件大小,值为0表示无限制,单位:KB */ /************************************************************************/ bool Initiliz e(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 ); };
下载地址
用户评论
码姐姐匿名网友 2018-12-15 11:13:11

呃,似乎Apache血统不是很纯的说