You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.7 KiB
C

#pragma once
#include "Module.h"
#include "GlobalDefine.h"
#include "EnumPropertieType.h"
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><D6BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
enum LOG_TYPE
{
_LOG_NORMAL=0,//<2F><><EFBFBD><EFBFBD>
_LOG_ERROR,//<2F><><EFBFBD><EFBFBD>
_LOG_FUNC,//<2F><><EFBFBD><EFBFBD>
};
class COutputWnd;
class CLog
{
friend class CLogMgr;
public:
CLog(void)
{
bCmdLog = false;
bDebugLog = false;
}
void AddCmdLog(){bCmdLog = true;};
void AddDebugLog(){bDebugLog = true;};
public:
CString str;
private:
bool bCmdLog;
bool bDebugLog;
};
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־log <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
class CLogMgr:public CModule
{
public:
CLogMgr(void);
~CLogMgr(void);
virtual void OnAppInitialize();
virtual CMFCPropertyGridProperty *CreatGridProperty();
virtual MODULE GetModuleType(){return _LOG_PROP;};
public:
void WriteLog(CLog &Log);
ofstream *GetResultOfstream(){return &m_ResultFile;};//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void WriteCmd(CString Cmd,CString val1,CString val2);
void WriteDebugLog(CString Str,LOG_TYPE type = _LOG_NORMAL);
void WriteDebugLog(CString Str,CString ValName1,CString ValName2,double val1,double val2);
void WriteDebugLog(CString Str,CString ValName,double val);
void WriteByte(BYTE bit);
void SetbWriteDebugLog(bool b){m_bWriteDebugLog = b;};
void WriteBuf(char *buf,int len);
CString GetLogFilePath();
void UpdateLogFileStream();
void OpenLogFileDir();
void WritePromptInfo(CString Str);
int GetMaxWorkRecodCnt(){return m_MaxWorkRecodCnt;};
CString GetLastLogStr();
void OpenLogListApp();
private:
void CreatLogFilePath();
CString GetLogPath();
void OpenLogListAppExt();
private:
COutputWnd * m_pOutputLog;//<2F><>־<EFBFBD><D6BE><EFBFBD><EFBFBD>
COutputWnd * m_pPromptInfo;//<2F><>ʾ<EFBFBD><CABE>Ϣ
bool m_bWriteDebugLog;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD>ļ<EFBFBD>
bool m_bWriteToLogList;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD>б<EFBFBD>
int m_LogListMaxLine;//<2F><>־<EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>
int m_MaxWorkRecodCnt;//<2F><><EFBFBD><EFBFBD><EFBFBD>ӹ<EFBFBD><D3B9><EFBFBD>¼<EFBFBD>IJ<EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ofstream m_LogFileStream;//<2F><><EFBFBD><EFBFBD>debug <20><><EFBFBD><EFBFBD>־<EFBFBD>ļ<EFBFBD>
ofstream m_ResultFile;//<2F><><EFBFBD>ڼ<EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
CString m_LastLogStr;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>־
bool m_bNotWriteSameLog;//<2F><>Ҫ<EFBFBD><D2AA>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD>־
CString m_CurDebugLogFilePath;//<2F><>־<EFBFBD>ļ<EFBFBD>·<EFBFBD><C2B7>,<2C><><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־·<D6BE><C2B7>
};
extern CLogMgr* gLogMgr;