log_manager.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2008 by Kutumov Alexey                                  *
00003  *   ru.pixel@gmail.com                                                    *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
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

Generated on Thu Mar 5 22:36:42 2009 for gpucalc by  doxygen 1.5.6