LibCT 2.0

Include/Logger.h

Go to the documentation of this file.
00001 // ------------------------------------------------------------------
00012 #ifndef _LIBCT_LOGGER_H
00013 #define _LIBCT_LOGGER_H
00014 
00015 #include <fstream>
00016 
00017 namespace LibCT
00018 {
00020         enum LogLevel
00021         {
00022                 LogLevelCritical,       
00023                 LogLevelWarning,        
00024                 LogLevelPedantic        
00025         };
00026 
00028 
00032         class Logger
00033         {
00034         public:
00035 
00038                 static Logger* Instance()
00039                 {
00040                         static Logger logger;
00041                         return &logger;
00042                 }
00043 
00045                 Logger();
00046 
00048                 ~Logger();
00049 
00051                 void Initialise();
00052                 
00054                 void Destroy();
00055 
00057                 void Log(
00058                         LogLevel level,                 
00059                         const char* pMessage    
00060                         );
00061 
00062         private:
00063                 bool                    m_Initialised;  
00064                 std::ofstream   m_File;                 
00065         };
00066 };
00067 
00068 #endif // _LIBCT_LOGGER_H