00001 //========================================================== 00002 // Logger.h 00003 // 00004 // Définition de la classe CLogger 00005 // 00006 //========================================================== 00007 00008 #ifndef LOGGER_H 00009 #define LOGGER_H 00010 00011 //========================================================== 00012 // En-têtes 00013 //========================================================== 00014 #include "SugoiTools\config.h" 00015 00016 namespace SGE{ 00017 /* 00018 *\brief Base Class for logging data at runtime. 00019 *\todo Finish writing the doc. 00020 */ 00021 class _SG_TLS_EXPORT ILogger 00022 { 00023 public : 00024 virtual ~ILogger(); 00025 00026 static void SetLogger(ILogger* Logger); 00027 static void Log(const char* Format, ...); 00028 ILogger& operator <<(const std::string & ToLog); 00029 ILogger& operator <<(const std::ostream& ToLog); 00030 00031 //ILogger& operator <<(const std::ostringstream & ToLog); 00032 //template <typename T> ILogger& operator <<(const T& ToLog); 00033 00034 static ILogger& Log(); 00035 00036 static ILogger* s_Instance; 00037 protected : 00038 00039 std::string CurrentDate() const; 00040 std::string CurrentTime() const; 00041 00042 private : 00043 00044 //---------------------------------------------------------- 00045 // Inscrit un message - à surdéfinir dans les classes dérivées 00046 //---------------------------------------------------------- 00047 virtual void Write(const std::string& Message) = 0; 00048 00049 //---------------------------------------------------------- 00050 // Détruit l'instance du logger 00051 //---------------------------------------------------------- 00052 static void Destroy(); 00053 00054 //---------------------------------------------------------- 00055 // Données membres 00056 //---------------------------------------------------------- 00057 00058 friend class CYesApplication; 00059 }; 00060 00061 //template <class T> ILogger& operator <<(const T& ToLog); 00062 };//namespace SGE 00063 #endif // LOGGER_H