00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #if !defined(AFX_FILELOG_H__D08640BA_1A6F_46F4_89D3_5F4A4A8D8541__INCLUDED_)
00037 #define AFX_FILELOG_H__D08640BA_1A6F_46F4_89D3_5F4A4A8D8541__INCLUDED_
00038
00039 #if _MSC_VER > 1000
00040 #pragma once
00041 #endif // _MSC_VER > 1000
00042
00043 #include "ErrorHandler.h"
00044
00045 #ifdef _DEBUG
00046 #include "TraceLog.h"
00047 #endif
00048
00049 #include <stdio.h>
00050
00051 KOMODIA_NAMESPACE_START
00052
00053 class CGenericCriticalSection;
00054
00055 class CFileLog : public CErrorHandler::CErrorLog
00056 {
00057 public:
00058
00059 void WriteLog(const std::string& rClass,
00060 const std::string& rMethod,
00061 const std::string& rMessage,
00062 CErrorHandler::LogPriority aPriority);
00063
00064
00065 void SetMaxLogSize(DWORD dwSize);
00066
00067
00068 BOOL Initialize(const std::string& rFileName);
00069
00070
00071 CFileLog();
00072 virtual ~CFileLog();
00073 protected:
00074
00075 virtual void ReportError(const std::string& rClass,
00076 const std::string& rMethod,
00077 const std::string& rMessage);
00078
00079
00080 virtual void WriteMessage(const std::string& rClass,
00081 const std::string& rMethod,
00082 const std::string& rMessage,
00083 CErrorHandler::LogPriority aPriority);
00084 private:
00085
00086 CFileLog(const CFileLog& rLog);
00087
00088
00089 CFileLog& operator=(const CFileLog& rLog);
00090
00091
00092 FILE* m_pFile;
00093
00094
00095 CGenericCriticalSection* m_pCSection;
00096
00097
00098 DWORD m_dwMaxLogSize;
00099
00100
00101 #ifdef _DEBUG
00102 CTraceLog m_aLog;
00103 #endif
00104 };
00105
00106 KOMODIA_NAMESPACE_END
00107
00108 #endif // !defined(AFX_FILELOG_H__D08640BA_1A6F_46F4_89D3_5F4A4A8D8541__INCLUDED_)