GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GwCentralLog.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2004 by Olivier Stezowski *
3  * stezow(AT)ipnl.in2p3.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 
26 #ifndef Gw_CentralLog
27 #define Gw_CentralLog
28 #define Gw_CENTRALLOG_H Gw_CentralLog
29 
30 #include <string>
31 #include <list>
32 
33 #include "SingletonDestroyer.h"
34 
35 namespace Gw {
36 
37 class LogCollector;
38 class LogMessage;
39 
41 
44 class CentralLog
45 {
46 private:
47  static CentralLog *gTheCentralLog;
48  static SingletonDestroyer<CentralLog> gTheCentralLogDestroyer;
49 
50 protected:
52 
53 private:
55  LogCollector *fCurrentCollector;
57  std::list < LogCollector * > fListOfCollectors;
58 
59 private:
60  CentralLog();
61  virtual ~CentralLog();
62 
63 public:
65  static CentralLog *theCentralLog();
66 
68  bool ChangeCollector(std::string whichlog = std::string("Null"));
69 
71 
73  bool IsCollector(std::string whichlog);
74 
77 
79 
85 
87 
89  // void Remove( std::string );
90 
91 };
92 
93 } // namespace Gw
94 
95 #endif
96 
97 
98 
99 
100 
bool IsCollector(std::string whichlog)
Check if the given collector already exists.
bool ChangeCollector(std::string whichlog=std::string("Null"))
to change the current collector
Base class for a Log collector.
LogCollector * GetCurrentLogCollector() const
Return the current logcollector.
To properly destroy a singleton.
LogCollector * Add(LogCollector *)
Add a new LogCollector to the list of known collectors.
CentralLog is a singleton that should be destroyed at exit time.
Definition: GwCentralLog.h:44
static CentralLog * theCentralLog()
CentralLog is a singleton.