Location:
Search - CLogFileEx
Search list
Description: 可以很方便的就能够在程序中输出日志等调试信息的类CLogFlieEx(这个是CLogFile的升级版,日志输出可以精确到毫秒级)。使用方法:添加*.cpp,和*.h文件到工程之后,实例化一个CLogFlie对象,之后直接调用AddRecord()函数就可用了。
Platform: |
Size: 3096 |
Author: 吴应 |
Hits:
Description: 可以很方便的就能够在程序中输出日志等调试信息的类CLogFlieEx(这个是CLogFile的升级版,日志输出可以精确到毫秒级)。使用方法:添加*.cpp,和*.h文件到工程之后,实例化一个CLogFlie对象,之后直接调用AddRecord()函数就可用了。-Can be very convenient to be able to log in the procedure output, such as the type of debugging information CLogFlieEx (This is an upgraded version of CLogFile, log output can be precise to the millisecond level). Usage: add*. cpp, and*. h files to the project after a CLogFlie instantiated object, followed by a direct call AddRecord () function can be used.
Platform: |
Size: 3072 |
Author: 吴应 |
Hits:
Description: ClogFileEx的事例
CLogFileEx是别人设计的日志记录类,我加入了事例代码
1、将ClogFileEx目录拷贝到工程所在目录
2、将两个文件加入到工程中
3、打开StdAfx.h
输入
#define LogFile
如果要关闭日志功能只需注释改行
4、在theApp中
定义public
#ifdef LogFile
CLogFile m_LogFile
#endif
5、在应用程序InitInstance中
#ifdef LogFile
m_LogFile.Set_cFileName("test.log")
m_LogFile.Set_cModuleName(" View")
m_LogFile.Set_cProcName(" PreCreateWindow")
m_LogFile.AddRecord(" Start log\n\t")
#endif
6、在JPClientWatch.h
#ifdef _LOGFILE
#include "CLogFileEx/LogFile.h"
#endif
7、
在其他的引用地方输入:
#ifdef _LOGFILE
CLogTestApp* theApp= (CLogTestApp*)AfxGetApp()
theApp->m_LogFile.Set_cModuleName(" View")
theApp->m_LogFile.Set_cProcName(" PreCreateWindow")
theApp->m_LogFile.AddRecord(" Start log\n\t")
#endif
-ClogFileEx example
Platform: |
Size: 135168 |
Author: cyc |
Hits: