activemq-cpp-3.9.5
LogManager.h
Go to the documentation of this file.
1/*
2* Licensed to the Apache Software Foundation (ASF) under one or more
3* contributor license agreements. See the NOTICE file distributed with
4* this work for additional information regarding copyright ownership.
5* The ASF licenses this file to You under the Apache License, Version 2.0
6* (the "License"); you may not use this file except in compliance with
7* the License. You may obtain a copy of the License at
8*
9* http://www.apache.org/licenses/LICENSE-2.0
10*
11* Unless required by applicable law or agreed to in writing, software
12* distributed under the License is distributed on an "AS IS" BASIS,
13* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14* See the License for the specific language governing permissions and
15* limitations under the License.
16*/
17#ifndef _DECAF_UTIL_LOGGING_LOGMANAGER_H_
18#define _DECAF_UTIL_LOGGING_LOGMANAGER_H_
19
20#include <map>
21#include <list>
22#include <string>
23#include <vector>
24
25#include <decaf/lang/Pointer.h>
28#include <decaf/util/Config.h>
29
33
34namespace decaf{
35namespace lang{
36 class Runtime;
37}
38namespace io{
39 class InputStream;
40}
41namespace util{
42namespace logging{
43
44 class Logger;
45 class LogManagerInternals;
46 class PropertyChangeListener;
47
48 using decaf::lang::Pointer;
49
148 private:
149
150 // Change listener on this class's Properties
151 std::list<PropertyChangeListener*> listeners;
152
153 // Properties of the Log Manager
154 util::Properties properties;
155
156 // Data structure for LogManager Internal data.
157 LogManagerInternals* internal;
158
159 public:
160
161 virtual ~LogManager();
162
175 bool addLogger( Logger* logger );
176
183 Logger* getLogger( const std::string& name );
184
194 int getLoggerNames( const std::vector<std::string>& names );
195
201 void setProperties( const util::Properties& properties );
202
209 return properties;
210 }
211
220 std::string getProperty( const std::string& name );
221
229 void addPropertyChangeListener( PropertyChangeListener* listener );
230
239 void removePropertyChangeListener( PropertyChangeListener* listener );
240
256
272
280 void reset();
281
282 public: // Static Singleton Methods.
283
289
290 private:
291
295 static void initialize();
296
300 static void shutdown();
301
302 protected:
303
308
313 LogManager( const LogManager& manager );
314
319 void operator=( const LogManager& manager );
320
321 private:
322
324
325 };
326
327}}}
328
329#endif /*_DECAF_UTIL_LOGGING_LOGMANAGER_H_*/
A base class that must be implemented by all classes wishing to provide a class that reads in a strea...
Definition InputStream.h:39
Definition Runtime.h:26
Java-like properties class for mapping string names to string values.
Definition Properties.h:53
Logger * getLogger(const std::string &name)
Retrieves or creates a new Logger using the name specified a new logger inherits the configuration of...
LogManager(const LogManager &manager)
Copy Constructor.
LogManager()
Constructor, hidden to protect against direct instantiation.
void removePropertyChangeListener(PropertyChangeListener *listener)
Removes a properties change listener from the LogManager, if the listener is not found of the param i...
const util::Properties & getProperties() const
Gets a reference to the Logging Properties used by this logger.
Definition LogManager.h:208
static LogManager & getLogManager()
Get the global LogManager instance.
void addPropertyChangeListener(PropertyChangeListener *listener)
Adds a change listener for LogManager Properties, adding the same instance of a change event listener...
void setProperties(const util::Properties &properties)
Sets the Properties this LogManager should use to configure its loggers.
void reset()
Reset the logging configuration.
std::string getProperty(const std::string &name)
Gets the value of a named property of this LogManager.
int getLoggerNames(const std::vector< std::string > &names)
Gets a list of known Logger Names from this Manager, new loggers added while this method is in progre...
void readConfiguration(decaf::io::InputStream *stream)
Reinitialize the logging properties and reread the logging configuration from the given stream,...
void readConfiguration()
Reinitialize the logging properties and reread the logging configuration.
void operator=(const LogManager &manager)
Assignment operator.
bool addLogger(Logger *logger)
Add a named logger.
A Logger object is used to log messages for a specific system or application component.
Definition Logger.h:86
#define DECAF_API
Definition Config.h:29
Definition BlockingByteArrayInputStream.h:25
Definition ThreadingTypes.h:31
Definition ConsoleHandler.h:28
Definition AbstractCollection.h:33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25