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 #ifndef SG_TLS_LOGMNGR_H
00028 #define SG_TLS_LOGMNGR_H
00029
00030 #include "SugoiTools\config.h"
00031 #include "SugoiTools\cl_template_manager.h"
00032 #include <iostream>
00033
00034
00035 namespace SGE{
00036
00040 class RunTimeEvent : public CL_BASE_OBJ<int>
00041 {
00042 public:
00043 enum Type
00044 {
00045 TpException,
00046 TpError,
00047 TpWarning,
00048 TpNotice,
00049 TpToDo,
00050 TpUnknown
00051 };
00052
00053 RunTimeEvent(const int _ID);
00054 RunTimeEvent(char * _File, int _Line, RunTimeEvent::Type _type, std::ostringstream _message);
00055 ~RunTimeEvent();
00056
00057 const std::string & GetFileName()const;
00058 int GetLine()const;
00059 const std::string & GetMsg()const;
00060 const time_t & GetTime()const;
00061 Type GetType()const;
00062
00063 std::ostringstream & operator << (std::ostringstream & _stream);
00064
00065 protected:
00066 std::string m_fileName;
00067 int m_line;
00068 std::string m_message;
00069 time_t m_time;
00070 Type m_type;
00071 static int m_eventLastID;
00072 };
00073
00074 class LogMngr
00075 {
00076 public:
00077 static
00078 LogMngr * GetInstance();
00079 bool AddEvent(RunTimeEvent * _event);
00080 protected:
00081 CL_TEMPLATE_OBJECT_MANAGER<RunTimeEvent, int> m_logMngr;
00082 static LogMngr * m_mainLogMngr;
00083 LogMngr();
00084 ~LogMngr();
00085 };
00086
00087
00088 };
00089
00090
00091 #endif