Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members
E:/Programming/MyProject/K_Game_hg/GameEngine/include/engine/LogManager.h
Go to the documentation of this file.
00001 // Copyright 2006-2011 by Kat'Oun
00002 
00003 #ifndef _LOG_MANAGER_H_
00004 #define _LOG_MANAGER_H_
00005 
00006 #include <EngineConfig.h>
00007 #include <core/Types.h>
00008 #include <core/Singleton.h>
00009 #include <engine/LogDefines.h>
00010 #include <engine/Object.h>
00011 
00012 #include <string>
00013 #include <map>
00014 #include <list>
00015 
00016 namespace engine
00017 {
00018 
00019 class Log;
00020 enum LogLevel;
00021 
00023 class ENGINE_PUBLIC_EXPORT LogManager: public Object, public core::Singleton<LogManager>
00024 {
00025 public:
00026 
00027         LogManager();
00028         ~LogManager();
00029         
00032         void setLogLevel(LogLevel ll);
00033 
00035         LogLevel getLogLevel();
00036 
00038         Log* createLog(const std::string& fileName, bool defaultLog = false);
00039         Log* createLog(const std::string& name, const std::string& fileName, bool defaultLog = false);
00040 
00042         Log* getLog(const u32& id);
00043 
00045         u32 getNumberOfLogs() const;
00046 
00048         void removeLog(Log* log);
00050         void removeLog(const u32& id);
00051 
00052         void removeAllLogs();
00053 
00055         Log* getDefaultLog();
00056 
00058         void setDefaultLog(Log* log);
00059 
00061         void pushLog(Log* log);
00063         void pushLog(const u32& id);
00064 
00066         void popLog();
00067 
00072         void logMessage(const std::string& source, const std::string& text, LogLevel ll = LL_INFORMATION);
00073 
00074         static LogManager* getInstance();
00075 
00076 protected:
00077 
00079         std::map<u32, Log*> mLogs;
00080 
00082         Log* mDefaultLog;
00083 
00085         std::list<Log*> mLogsList;
00086 
00088         LogLevel mLogLevel;
00089 };
00090 
00091 } // end namespace engine
00092 
00093 #endif

The KG Game Engine
The KG Game Engine Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:04 by Doxygen (1.7.4)