📄 log.h
字号:
// Log.h: interface for the CLog class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_LOG_H__3FD3B9A9_ABAA_40B9_98CE_2A8B838E69FD__INCLUDED_)
#define AFX_LOG_H__3FD3B9A9_ABAA_40B9_98CE_2A8B838E69FD__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//#include <stdio.h>
//#include <iostream.h>
#include <fstream.h>
//#include <time.h>
const LOG_LEVEL_ACT = 1; //action
const LOG_LEVEL_AER = 2; //act error
const LOG_LEVEL_CER = 3; //code error
class CLog
{
public:
CLog();
virtual ~CLog();
static void WriteLine( const char* szMsg );
static void WriteLine( const char* szMsg, int nLine, const char* szFileName );
static void WriteLine( long dw, const char* szMsg=NULL );
protected:
static CLog m_oLog;
//日志文件路径
char m_strLogFilePath[MAX_PATH];
//日志文件句柄
ofstream* m_objptrOfstream;
void initFile();
void closeFile();
void writeTime();
void write( const char* szMsg );
void writeLine( const char* szMsg );
};
#endif // !defined(AFX_LOG_H__3FD3B9A9_ABAA_40B9_98CE_2A8B838E69FD__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -