log_manager.h
Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00033 #ifndef __log_manager__header__
00034 #define __log_manager__header__
00035 
00036 #include "gpucalc/singleton.h"
00037 #include "gpucalc/log.h"
00038 
00039 namespace gpucalc
00040 {
00041  const char _LogManagerObjectName [] = "LogManager";
00042 
00048  class _GpuCalcExport LogManager: public Singleton<LogManager>
00049  {
00050   public:
00051 
00052 
00053    LogManager();
00054 
00055 
00056    ~LogManager();
00057 
00058 
00080    Log * createLog(const std::string & name, bool defaultLog = false, unsigned int LogClassNameAlignment = 15,
00081     unsigned int LogObjectNameAlignment = 20, bool DebugOutput = true, bool SuppressFileOutput = false,
00082     bool SuppressObjectInfo = false);
00083 
00084 
00088    Log * getLog(const std::string & name);
00089 
00090 
00094    Log * getDefaultLog();
00095 
00096 
00100    void destroyLog(const std::string & name);
00101 
00102 
00106    void destroyLog(Log * log);
00107 
00108 
00113    Log * setDefaultLog(Log * newLog);
00114 
00115 
00119    void logMessage(const Object & object, const std::string & Message,
00120     LogMessageLevel lml = LML_Normal, bool maskDebug = false);
00121 
00122 
00123    void logMessage(const Object * object, const std::string & Message,
00124     LogMessageLevel lml = LML_Normal, bool maskDebug = false);
00125 
00126 
00127    void logMessage(const std::string & LogId, const Object * object, const std::string & Message,
00128     LogMessageLevel lml = LML_Normal, bool maskDebug = false);
00129 
00130 
00131    void logMessage(const std::string & LogId, const Object & object, const std::string & Message,
00132     LogMessageLevel lml = LML_Normal, bool maskDebug = false);
00133 
00134 
00135    
00139    void setLogDetail(LoggingLevel ll);
00140 
00141 
00142    LoggingLevel getLogDetail();
00143 
00144 
00148    static LogManager & getSingleton();
00149 
00150 
00154    static LogManager * getSingletonPtr();
00155 
00156 
00157   protected:
00158 
00159 
00160    typedef std::map<std::string, Log *, std::less<std::string> > LogMap;
00161 
00162 
00166    LogMap mLogMap;
00167 
00168 
00172    Log * mDefaultLog;
00173  };
00174 }
00175 
00176 #endif